-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | simple binding of css and html -- -- Library binds css and html. It takes notion of html for content, -- css for styling to extreme. There are functions to build 'styling -- tree' and html elements can be placed only in the lists of the tree. -- Html elements can be groupped with div, span or a -- tags and styled with subset of css. Result of the programm is string -- of css code and list of html elements. Module SimpleCss -- contains core functions of the library and SimpleCss.Tricks -- translates some css tricks i've found in the web. See -- 'example/Main.hs' to get started @package simple-css @version 0.0.4 module SimpleCss -- | representing Css data type -- -- Css's parameter is html type data Css a type CssCode = String type Href = String type Tag = String type Pseudo = [(PseudoVal, [Decl])] type Context = [Tag] -- | html element constructor prim :: a -> Css a -- | span groupping hcat :: [Css a] -> Css a -- | div groupping vcat :: [Css a] -> Css a -- | a groupping acat :: Href -> [Css a] -> Css a -- | vcat for singleton div' :: Css a -> Css a -- | hcat for singleton span' :: Css a -> Css a -- | acat for singleton a' :: Href -> Css a -> Css a -- | set class dot :: [Decl] -> Css a -> Css a -- | set class with pseudo- element/class pseudo :: Pseudo -> Css a -> Css a -- | styles descendants context :: Context -> [Decl] -> Css a -> Css a -- | Html specification -- -- to render css you should specify html's elements groupping with -- a, div and span tags and way to assign -- values of class attribute data HtmlSpec a HtmlSpec :: ([a] -> a) -> ([a] -> a) -> (Href -> [a] -> a) -> (String -> a -> a) -> HtmlSpec a divTag :: HtmlSpec a -> [a] -> a spanTag :: HtmlSpec a -> [a] -> a aTag :: HtmlSpec a -> Href -> [a] -> a classAttr :: HtmlSpec a -> String -> a -> a -- | render css -- -- returns string of css code and list of htmls renderCss :: HtmlSpec a -> [Css a] -> ([RuleSet], [a]) -- | render css for blaze-html toBlaze :: [Css Html] -> ([RuleSet], [Html]) instance Eq Rule instance Show RuleType instance Eq RuleType instance Ord RuleType instance Hashable PseudoVal instance Hashable Decl instance Hashable Rule module SimpleCss.Tricks.Shortcuts.Html -- | p tag p :: String -> Css Html -- | a tag -- -- arguments -- --
-- hor = [left, right] --hor :: [Dir] -- |
-- ver = [top, bottom] --ver :: [Dir] -- |
-- sides = [left, top, right, bottom] --sides :: [Dir] -- | sets float property to left lfloat :: [Decl] -- | sets float property to right rfloat :: [Decl] -- | sets clear property to right rclear :: [Decl] -- | sets clear property to left lclear :: [Decl] -- | sets clear property to both bclear :: [Decl] type BorderStyle = Expr type BorderWidth = Expr type BorderColor = Expr -- | sets border properties border :: [Dir] -> BorderStyle -> BorderWidth -> BorderColor -> [Decl] -- | sets border property to none and assigns -- border-width to zero borderNone :: [Dir] -> [Decl] -- | sets border-radius property borderRadius :: [Expr] -> [Decl] -- | sets margin width margin :: [Dir] -> Expr -> [Decl] -- | sets padding width padding :: [Dir] -> Expr -> [Decl] -- | sets wdth width :: Expr -> [Decl] -- | sets height height :: Expr -> [Decl] -- | sets background-color property bkgColor :: Expr -> [Decl] -- | sets color and background-color properties brick :: Expr -> Expr -> [Decl] -- | loads picture to background pict :: String -> [Decl] -- | sets color property to specified color color :: Expr -> [Decl] -- | Box model -- -- elements groupped in box can be displayed as block or as -- inline-block data Box -- | block box box :: [Decl] -> Box -- | inline-block box ibox :: [Decl] -> Box -- | static box static :: Box -> Css a -> Css a -- | rollover box -- -- arguments : -- --
-- leftPad + midWidth + rightPad --totalWidth :: Num a => ColumnWidth a -> a -- | short-cut for ColumnWidth constructor colw :: Num a => a -> a -> a -> ColumnWidth a -- | construct list of columnWidth values from list of triplets toColumnWidth :: [(a, a, a)] -> [ColumnWidth a] -- | left menu + content -- -- arguments are : -- --
-- elems = [p text1, p text2] -- -- decl1 = dot [C.color <:> white, C.backgroundColor <:> black] -- decl2 = dot [C.color <:> black, C.backgroundColor <:> white] -- ds = [decl1, decl2] -- -- ws = toColumnWidth [(10, 40, 10), (10, 40, 10)] -- -- res = columns pct (zip (zip ws ds) elems) --columns :: Num t => (t -> Expr) -> [((ColumnWidth t, Css a -> Css a), Css a)] -> Css a instance Show a => Show (ColumnWidth a) module SimpleCss.Tricks.Menus -- | horizontal menu hmenu :: [Css a] -> Css a -- | relative horizontal menu, everything is forced to equal width hmenuRel :: [Css a] -> Css a -- | vertical menu vmenu :: [Css a] -> Css a -- | making tabs -- -- arguments -- --