{-# LANGUAGE RecordWildCards #-}
module Graphics.Layout.Box where
data Border n = Border {
top :: n, bottom :: n, left :: n, right :: n
}
data Size n = Size {inline :: n, block :: n}
data PaddedBox n = {
min :: Size n,
max :: Size n,
size :: Size n,
padding :: Border n,
border :: Border n,
margin :: Border n
}
width' PaddedBox {..} = left margin + left border + left padding +
inline size + right padding + right border + right margin
height' PaddedBox {..} = top margin + top border + top padding +
block size + bottom padding + bottom border + bottom margin
data Length = Pixels Double | Percent Double | Auto | Preferred | Min