Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Combinators to build AST
Example :
import Language.Css.Syntax import Language.Css.Build import Language.Css.Pretty import Language.Css.Build.Idents import Language.Css.Build.Tags hiding (center) res = ruleSets [ body [ margin <:> int 0, border <:> int 0 ], h1 [ textAlign <:> center], p [ backgroundColor <:> black, color <:> white, padding <:> spaces [pct 5, pct 5, pct 10, pct 10] ], (star /. "warning") [ color <:> red ] ] main = print $ pretty res
Synopsis
- class Idents a where
- class ToExpr a where
- styleSheet :: Maybe AtCharSet -> [AtImport] -> [StyleBody] -> StyleSheet
- rules :: [StyleBody] -> StyleSheet
- ruleSets :: [RuleSet] -> StyleSheet
- addImports :: [AtImport] -> StyleSheet -> StyleSheet
- addRules :: [StyleBody] -> StyleSheet -> StyleSheet
- charset :: String -> StyleSheet -> StyleSheet
- media :: [String] -> [RuleSet] -> StyleBody
- page :: Maybe String -> Maybe PseudoPage -> [Decl] -> StyleBody
- fontFace :: [Decl] -> StyleBody
- type Sel' = [Decl] -> RuleSet
- star :: Sel'
- sels :: [Sel'] -> Sel'
- (/>) :: Sel' -> Sel' -> Sel'
- (/-) :: Sel' -> Sel' -> Sel'
- (/#) :: Sel' -> String -> Sel'
- (/.) :: Sel' -> String -> Sel'
- (/:) :: Sel' -> PseudoVal -> Sel'
- class Attrs a where
- (!) :: Sel' -> Attr -> Sel'
- (.=) :: AttrIdent -> AttrVal -> Attr
- (~=) :: AttrIdent -> AttrVal -> Attr
- (|=) :: AttrIdent -> AttrVal -> Attr
- (<:>) :: String -> Expr -> Decl
- important :: Decl -> Decl
- space :: Expr -> Expr -> Expr
- slash :: Expr -> Expr -> Expr
- comma :: Expr -> Expr -> Expr
- spaces :: [Expr] -> Expr
- slashes :: [Expr] -> Expr
- commas :: [Expr] -> Expr
- fun :: ToExpr a => Ident -> a -> Func
- str :: String -> Expr
- int :: Int -> Expr
- num :: Double -> Expr
- deg :: Double -> Expr
- rad :: Double -> Expr
- grad :: Double -> Expr
- cword :: String -> Expr
- rgb :: Int -> Int -> Int -> Expr
- hz :: Double -> Expr
- khz :: Double -> Expr
- em :: Double -> Expr
- ex :: Double -> Expr
- px :: Int -> Expr
- in' :: Double -> Expr
- cm :: Double -> Expr
- mm :: Double -> Expr
- pc :: Double -> Expr
- pt :: Int -> Expr
- pct :: Double -> Expr
- ms :: Double -> Expr
- s :: Double -> Expr
- url :: String -> Expr
- aqua :: Expr
- black :: Expr
- blue :: Expr
- fuchsia :: Expr
- gray :: Expr
- green :: Expr
- lime :: Expr
- maroon :: Expr
- navy :: Expr
- olive :: Expr
- orange :: Expr
- purple :: Expr
- red :: Expr
- silver :: Expr
- teal :: Expr
- white :: Expr
- yellow :: Expr
Classes
Instances
ToExpr Double Source # | |
ToExpr Int Source # | |
ToExpr Uri Source # | |
ToExpr S Source # | |
ToExpr Ms Source # | |
ToExpr Percentage Source # | |
Defined in Language.Css.Build expr :: Percentage -> Expr Source # | |
ToExpr Pt Source # | |
ToExpr Pc Source # | |
ToExpr Mm Source # | |
ToExpr Cm Source # | |
ToExpr In Source # | |
ToExpr Px Source # | |
ToExpr Ex Source # | |
ToExpr Em Source # | |
ToExpr KHz Source # | |
ToExpr Hz Source # | |
ToExpr Color Source # | |
ToExpr Grad Source # | |
ToExpr Rad Source # | |
ToExpr Deg Source # | |
ToExpr Func Source # | |
ToExpr Value Source # | |
ToExpr Expr Source # | |
ToExpr Ident Source # | |
ToExpr a => ToExpr [a] Source # | |
Defined in Language.Css.Build |
StyleSheet
styleSheet :: Maybe AtCharSet -> [AtImport] -> [StyleBody] -> StyleSheet Source #
rules :: [StyleBody] -> StyleSheet Source #
construct StyleSheet
from list of AtRule
's or RuleSet
's
ruleSets :: [RuleSet] -> StyleSheet Source #
construct StyleSheet
from list of RuleSet
's
addImports :: [AtImport] -> StyleSheet -> StyleSheet Source #
append imports
addRules :: [StyleBody] -> StyleSheet -> StyleSheet Source #
append rules
charset :: String -> StyleSheet -> StyleSheet Source #
set @charset
AtRules
RuleSets
Selectors
attribute selector