Safe Haskell | Safe-Infered |
---|
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
- 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
StyleSheet
styleSheet :: Maybe AtCharSet -> [AtImport] -> [StyleBody] -> StyleSheetSource
rules :: [StyleBody] -> StyleSheetSource
construct StyleSheet
from list of AtRule
's or RuleSet
's
ruleSets :: [RuleSet] -> StyleSheetSource
construct StyleSheet
from list of RuleSet
's
addImports :: [AtImport] -> StyleSheet -> StyleSheetSource
append imports
addRules :: [StyleBody] -> StyleSheet -> StyleSheetSource
append rules
charset :: String -> StyleSheet -> StyleSheetSource
set @charset