Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Datastructures representing the CSS box model, & utilities for operating on them.
Synopsis
- data Border m n = Border {}
- mapX :: (n -> nn) -> Border m n -> Border m nn
- mapY :: (m -> mm) -> Border m n -> Border mm n
- data Size m n = Size {}
- mapSizeX :: (n -> nn) -> Size m n -> Size m nn
- mapSizeY :: (m -> mm) -> Size m n -> Size mm n
- data PaddedBox m n = PaddedBox {}
- zeroBox :: PaddedBox Double Double
- lengthBox :: PaddedBox Length Length
- mapX' :: (n -> nn) -> PaddedBox m n -> PaddedBox m nn
- mapY' :: (m -> mm) -> PaddedBox m n -> PaddedBox mm n
- width :: Num n => PaddedBox m n -> n
- height :: Num m => PaddedBox m n -> m
- minWidth :: Num n => PaddedBox m n -> n
- minHeight :: Num m => PaddedBox m n -> m
- maxWidth :: Num n => PaddedBox m n -> n
- maxHeight :: Num m => PaddedBox m n -> m
- leftSpace :: Num n => PaddedBox m n -> n
- rightSpace :: Num n => PaddedBox m n -> n
- topSpace :: Num m => PaddedBox m n -> m
- bottomSpace :: Num m => PaddedBox m n -> m
- hSpace :: Num n => PaddedBox m n -> n
- vSpace :: Num m => PaddedBox m n -> m
- data Length
- mapAuto :: Double -> Length -> Length
- lowerLength :: Double -> Length -> Double
- class Zero a where
- zero :: a
- class CastDouble a where
- fromDouble :: Double -> a
- toDouble :: a -> Double
Documentation
Amount of space surrounding the box.
mapX :: (n -> nn) -> Border m n -> Border m nn Source #
Convert horizontal spacing via given callback.
2D size of a box. Typically inline is width & block is height. This may change as support for vertical layout is added.
A box with min & max bounds & surrounding borders. The CSS Box Model.
PaddedBox | |
|
lengthBox :: PaddedBox Length Length Source #
A box which takes up all available space with no borders.
mapX' :: (n -> nn) -> PaddedBox m n -> PaddedBox m nn Source #
Convert all sizes along the inline axis via given callback.
mapY' :: (m -> mm) -> PaddedBox m n -> PaddedBox mm n Source #
Convert all sizes along the block axis via given callback.
width :: Num n => PaddedBox m n -> n Source #
The total size along the inline axis including borders, etc.
height :: Num m => PaddedBox m n -> m Source #
The total size along the block axis, including borders, etc.
rightSpace :: Num n => PaddedBox m n -> n Source #
bottomSpace :: Num m => PaddedBox m n -> m Source #
A partially-computed length value.
Pixels Double | Absolute number of device pixels. |
Percent Double | Multiplier by container width. |
Auto | Use normal layout computations. |
Preferred | Use computed preferred width. |
Min | Use minimum legible width. |
Instances
Eq Length Source # | |
CastDouble Length Source # | |
Defined in Graphics.Layout.Box | |
Zero Length Source # | |
Defined in Graphics.Layout.Box |
mapAuto :: Double -> Length -> Length Source #
Replace keywords with a given number of pixels. Useful for avoiding messing up percentage calculations in later processing.
lowerLength :: Double -> Length -> Double Source #
Convert a length given the container's width. Filling in 0 for keywords. If you wish for keywords to be handled differently, callers need to compute that themselves.
class CastDouble a where Source #
fromDouble :: Double -> a Source #
Convert a double to a double or length.
toDouble :: a -> Double Source #
Convert a double or length to a double.
Instances
CastDouble Double Source # | |
Defined in Graphics.Layout.Box | |
CastDouble Length Source # | |
Defined in Graphics.Layout.Box |