cattrap-0.2.0.0: Lays out boxes according to the CSS Box Model.
Safe HaskellNone
LanguageHaskell2010

Graphics.Layout.Grid.CSS

Description

Infrastructure for parsing & desugaring grid-layout related CSS properties.

Synopsis

Documentation

data CSSGrid Source #

Parsed CSS Grid properties

Constructors

CSSGrid 

Fields

Instances

Instances details
PropertyParser CSSGrid Source # 
Instance details

Defined in Graphics.Layout.Grid.CSS

Methods

temp :: CSSGrid

inherit :: CSSGrid -> CSSGrid

priority :: CSSGrid -> [Text]

shorthand :: CSSGrid -> Text -> [Token] -> [(Text, [Token])]

longhand :: CSSGrid -> CSSGrid -> Text -> [Token] -> Maybe CSSGrid

getVars :: CSSGrid -> Props

setVars :: Props -> CSSGrid -> CSSGrid

pseudoEl :: CSSGrid -> Text -> (CSSGrid -> Maybe CSSGrid -> CSSGrid) -> CSSGrid

data Axis Source #

A grid axis.

Constructors

Row 
Col 

Instances

Instances details
Eq Axis Source # 
Instance details

Defined in Graphics.Layout.Grid.CSS

Methods

(==) :: Axis -> Axis -> Bool

(/=) :: Axis -> Axis -> Bool

data CSSCell Source #

Parsed CSS grid item properties.

Constructors

CSSCell 

Fields

Instances

Instances details
PropertyParser CSSCell Source # 
Instance details

Defined in Graphics.Layout.Grid.CSS

Methods

temp :: CSSCell

inherit :: CSSCell -> CSSCell

priority :: CSSCell -> [Text]

shorthand :: CSSCell -> Text -> [Token] -> [(Text, [Token])]

longhand :: CSSCell -> CSSCell -> Text -> [Token] -> Maybe CSSCell

getVars :: CSSCell -> Props

setVars :: Props -> CSSCell -> CSSCell

pseudoEl :: CSSCell -> Text -> (CSSCell -> Maybe CSSCell -> CSSCell) -> CSSCell

data Placement Source #

Identifies a cell in the CSS grid.

Constructors

Autoplace 
Named Text 
Numbered Int (Maybe Text) 
Span Int (Maybe Text) 

finalizeGrid :: PropertyParser x => CSSGrid -> Font' -> [CSSCell] -> [LayoutItem Length Length x] -> LayoutItem Length Length x Source #

Desugar grid properties to a grid layout.

type Areas = HashMap Text ((Int, Int), (Int, Maybe Int)) Source #

parseASCIIGrid :: [[Text]] -> Int -> Areas -> Maybe Areas Source #

Converts a grid to lookup table start & indices for row & columns. Exported for the sake of testing