BluePrintCSS-0.1: Html document layout library.

Text.BluePrintCSS.Base

Synopsis

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>
   ] 
 ]

section :: a -> b -> c -> (a, b, c)Source

data Layout Source

User can specify fixed of `greater than` width of section. Width is measured in blueprint css units (see official manual)

Constructors

LEQ Int 
LGE Int 

Instances

class AsSection a d whereSource

Methods

asSection :: a -> Int -> Bool -> [d] -> dSource

asRootSection :: a -> [d] -> dSource

class AsMargin x whereSource

Methods

smargin :: x -> IntSource

Instances

class AsCssClass x whereSource

Methods

asCssClass :: x -> [String]Source

Instances

data Tag a d Source

Defines Html section tree from blueprint's point of view.

Constructors

Tag Align [Tuple a d] 
Content d 

Instances

(Show a, Show d) => Show (Tag a d) 

data Align Source

Constructors

HSet 
VSet 

Instances

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.

hsection :: Monoid a => [Tuple a d] -> Tuple a dSource

Starts horisontally aligned sectionlist

vsectionA :: a -> [Tuple a d] -> Tuple a dSource

Attributed version of vsection

vsection :: Monoid a => [Tuple a d] -> Tuple a dSource

Starts vertically aligned section

equalA :: a -> Int -> d -> Tuple a dSource

Attributed version of equal

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

greaterA :: a -> Int -> d -> Tuple a dSource

Attributed version of greater

greater :: Monoid a => Int -> d -> Tuple a dSource

Defines html content with width in range [arg1 .. max). First argument is a minimal width allowed (in blueprintcss units, see manual). Second argument - html data type

floatA :: a -> d -> Tuple a dSource

Attributed version of float

float :: Monoid a => d -> Tuple a dSource

Defines html content with any width (same as greater with arg1 = 0)