-- 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 -- -- a :: String -> String -> Css Html -- | images -- -- arguments : -- -- img :: String -> String -> Css Html -- | pre tag pre :: String -> Css Html -- | h1 tag h1 :: String -> Css Html -- | h2 tag h2 :: String -> Css Html -- | h3 tag h3 :: String -> Css Html -- | h4 tag h4 :: String -> Css Html -- | h5 tag h5 :: String -> Css Html -- | h6 tag h6 :: String -> Css Html -- | ul tag ul :: [String] -> Css Html -- | ol tag ol :: [String] -> Css Html -- | ul tag with links -- -- arguments : [(href, text)] aul :: [(String, String)] -> Css Html -- | ol tag with links -- -- arguments : [(href, text)] aol :: [(String, String)] -> Css Html -- | table -- -- arguments : -- -- table :: Maybe [String] -> [[String]] -> Css Html encoding :: String -> Html -- | writes css and htmls to files -- -- arguments : -- -- writeBlazeCss :: String -> StyleSheet -> [((String, Html), Css Html)] -> IO () -- | genereates html filenames and head's sublelements from list of titles initHtmls :: [String] -> [(String, Html)] -- | styling shortcuts module SimpleCss.Tricks.Shortcuts.Css data Dir DAll :: Dir DLeft :: Dir DRight :: Dir DBottom :: Dir DTop :: Dir top :: Dir bottom :: Dir left :: Dir right :: Dir -- |
--   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 : -- -- rollOver :: Box -> Box -> Css a -> Css a -- | mouse-interaction box arguments : -- -- -- -- box onMouse :: Box -> Box -> Box -> Box -> (Css a -> Css a) instance Show Dir module SimpleCss.Tricks.Layouts -- | setting width in procents (^-) :: Double -> Css a -> Css a -- | setting height in procents (^|) :: Double -> Css a -> Css a -- | represents column layout data ColumnWidth a ColumnWidth :: a -> a -> a -> ColumnWidth a -- | left padding width leftPad :: ColumnWidth a -> a -- | content width midWidth :: ColumnWidth a -> a -- | right padding width rightPad :: ColumnWidth a -> a -- |
--   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 : -- -- leftContent :: Num t => (t -> Expr) -> t -> Css a -> Css a -> Css a -- | content + right menu -- -- arguments are : -- -- rightContent :: Num t => (t -> Expr) -> t -> Css a -> Css a -> Css a -- | left menu + content + right menu -- -- arguments are : -- -- leftRightContent :: Num t => (t -> Expr) -> t -> t -> Css a -> Css a -> Css a -> Css a -- | liquid layouts -- -- Places n-columns, implementation of Matthew James Taylor's liquid -- layout technique. -- -- See -- http://matthewjamestaylor.com/blog/equal-height-columns-cross-browser-css-no-hacks -- -- every columns is wrapped in two divs (inner an outer) and floated, -- styling is applied to both divs, it makes possible to construct -- columns of equal height, they look like. -- -- All inherited properties should be assigned for each column. -- -- For example if you want to make two columns one is black background -- and white text and another mirrors colors, you should define colors -- for BOTH columns. Otherwise one column will spread all over the screen -- --
--   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 -- -- -- -- result -- -- tabs :: ([Css a] -> Css a) -> [Box] -> [Box] -> [Css a] -> [Css a] module SimpleCss.Tricks.Images -- | representing background images data BkgIm BkgIm :: String -> Expr -> Expr -> Expr -> BkgIm bkgImUrl :: BkgIm -> String bkgImRepeat :: BkgIm -> Expr bkgImXPos :: BkgIm -> Expr bkgImYPos :: BkgIm -> Expr -- | synonym to BkgIm -- -- arguments are -- -- bkgIm :: String -> Expr -> Expr -> Expr -> BkgIm -- | set of background images -- -- arguments -- -- -- -- head of list is on top, then goes second image and etc. bkgIms :: Expr -> [BkgIm] -> Css a -> Css a -- | floating gallery of images gallery :: [Css a] -> Css a module SimpleCss.Tricks