| Copyright | (C) 2016-2025 David M. Johnson (@dmjio) |
|---|---|
| License | BSD3-style (see the file LICENSE) |
| Maintainer | David M. Johnson <code@dmj.io> |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Miso.CSS.Types
Contents
Description
Types for CSS, including inline styles and StyleSheets.
Synopsis
- type Style = (MisoString, MisoString)
- data Styles
- = Styles (MisoString, [Style])
- | KeyFrame MisoString [(MisoString, [Style])]
- | Media MisoString [(MisoString, [Style])]
- newtype StyleSheet = StyleSheet {
- getStyleSheet :: [Styles]
Types
type Style = (MisoString, MisoString) Source #
Type for a CSS Style
Type for a Map of CSS Style. Used with StyleSheet.
It maps CSS properties to their values.
Constructors
| Styles (MisoString, [Style]) | |
| KeyFrame MisoString [(MisoString, [Style])] | |
| Media MisoString [(MisoString, [Style])] |
newtype StyleSheet Source #
Type for a CSS StyleSheet. Internally it maps From CSS selectors to Styles.
testSheet :: StyleSheet
testSheet =
sheet_
[ selector_ ".name"
[ backgroundColor red
, alignContent "top"
]
, selector_ "#container"
[ backgroundColor blue
, alignContent "center"
]
, keyframes_ "slide-in"
[ "from" =:
[ transform "translateX(0%)"
]
, "to" =:
[ transform "translateX(100%)"
, backgroundColor red
, backgroundSize "10px"
, backgroundRepeat "true"
]
, pct 10 =:
[ "foo" =: "bar"
]
]
, media_ "screen and (min-width: 480px)"
[ "header" =:
[ height "auto"
]
, "ul" =:
[ display "block"
]
]
]
Constructors
| StyleSheet | |
Fields
| |
Instances
| Show StyleSheet Source # | |
Defined in Miso.CSS.Types Methods showsPrec :: Int -> StyleSheet -> ShowS # show :: StyleSheet -> String # showList :: [StyleSheet] -> ShowS # | |
| Eq StyleSheet Source # | |
Defined in Miso.CSS.Types | |