Text.BluePrintCSS.Base
- render :: (AsMargin a, AsSection a d) => Int -> Tuple a d -> Either String d
- section :: a -> b -> c -> (a, b, c)
- data Layout
- class AsSection a d where
- asSection :: a -> Int -> Bool -> [d] -> d
- asRootSection :: a -> [d] -> d
- class AsMargin x where
- class AsCssClass x where
- asCssClass :: x -> [String]
- makeCssClass :: AsCssClass x => x -> Int -> Bool -> [String]
- data Tag a d
- data Align
- hsectionA :: a -> [Tuple a d] -> Tuple a d
- hsection :: Monoid a => [Tuple a d] -> Tuple a d
- vsectionA :: a -> [Tuple a d] -> Tuple a d
- vsection :: Monoid a => [Tuple a d] -> Tuple a d
- equalA :: a -> Int -> d -> Tuple a d
- equal :: Monoid a => Int -> d -> Tuple a d
- greaterA :: a -> Int -> d -> Tuple a d
- greater :: Monoid a => Int -> d -> Tuple a d
- floatA :: a -> d -> Tuple a d
- float :: Monoid a => d -> Tuple a d
Documentation
render :: (AsMargin a, AsSection a d) => Int -> Tuple a d -> Either String dSource
The most important function. Renders structure into solid html. First argument is total width of your css grid (see blueprintcss manual). Typical value is 24. Second argument is the document skeleton as returned by one of *section functions. Use it like this (HSX html generator is assumed):
render 24 $ vsection [ float $ <h1> The header </h1>, floatA [Box "Error"] $ <p>Password incorrect</p>, hsection [ equal 3 $ <div> Column of width 3 </div>, float $ <div> Column of width (max - 3) </div> ] ]
User can specify fixed of `greater than` width of section. Width is measured in blueprint css units (see official manual)
makeCssClass :: AsCssClass x => x -> Int -> Bool -> [String]Source
Defines Html section tree from blueprint's point of view.
hsectionA :: a -> [Tuple a d] -> Tuple a dSource
Attributed version of hsection.
First argument is a attribute list which allows to tweak `class` of html tag.
Standard blueprint library contains a set of pre-defined classes like
error
, notify
, box
, `append-`, `prepend-`.
Some of them, like `pull-` and `push-` are not supported.
See Attr
for details.
equal :: Monoid a => Int -> d -> Tuple a dSource
Defines html content of fixed width. First argument is a width allowed for this content (in blueprintcss units, see manual). Second argument - html data type