| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Clay.Box
Contents
Synopsis
- data BoxType
- paddingBox :: BoxType
- borderBox :: BoxType
- contentBox :: BoxType
- boxSizing :: BoxType -> Css
- boxShadow :: NonEmpty BoxShadow -> Css
- shadow :: Size a -> Size a -> BoxShadow
- shadowWithBlur :: Size a -> Size a -> Size a -> BoxShadow
- shadowWithSpread :: Size a -> Size a -> Size a -> Size a -> BoxShadow
- bsInset :: BoxShadow -> BoxShadow
- bsColor :: Color -> BoxShadow -> BoxShadow
- boxShadow' :: Size a -> Size a -> Size a -> Color -> Css
- boxShadowWithSpread :: Size a -> Size a -> Size a -> Size a -> Color -> Css
- boxShadows :: [(Size a, Size a, Size a, Color)] -> Css
- insetBoxShadow :: Stroke -> Size a -> Size a -> Size a -> Color -> Css
Documentation
paddingBox :: BoxType Source #
contentBox :: BoxType Source #
box-shadow
Formal argument syntax
none | <shadow>#
where
<shadow> = inset? && <length>{2,4} && <color>?
where
<color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>
where
<rgb()> = rgb( [ [ <percentage>{3} | <number>{3} ] [ / <alpha-value> ]? ] | [ [ <percentage>#{3} | <number>#{3} ] , <alpha-value>? ] )
<rgba()> = rgba( [ [ <percentage>{3} | <number>{3} ] [ / <alpha-value> ]? ] | [ [ <percentage>#{3} | <number>#{3} ] , <alpha-value>? ] )
<hsl()> = hsl( [ <hue> <percentage> <percentage> [ / <alpha-value> ]? ] | [ <hue>, <percentage>, <percentage>, <alpha-value>? ] )
<hsla()> = hsla( [ <hue> <percentage> <percentage> [ / <alpha-value> ]? ] | [ <hue>, <percentage>, <percentage>, <alpha-value>? ] )
where
<alpha-value> = <number> | <percentage>
<hue> = <number> | <angle>boxShadow :: NonEmpty BoxShadow -> Css Source #
This function will usually take a singleton list, but requiring a (non-empty)
list prevents accidentally applying the modifiers (bsInset, bsColor)
incorrectly.
pure (from Control.Applicative) creates a singleton list.
boxShadow . pure $ none boxShadow . pure $ shadow (px 1) (px 1)
Use with {-# LANGUAGE OverloadedLists #-} for the simplest list syntax.
Note that sometimes when {-# LANGUAGE OverloadedLists #-} is active, GHC
has troubles identifying what type the list should be converted to. Examples:
1) "forM_ [0..10] $ x -> ..."
2) "[left, top, right, bottom] forM_ ($ pct 4)"
boxShadow [none] boxShadow [shadow (px 1) (px 1)]
This is recommended for supplying multiple BoxShadow values.
boxShadow [shadowWithBlur (em 2) (em 1), bsInset . bsColor red $ shadow (px 1) (px 2)]
bsInset :: BoxShadow -> BoxShadow Source #
Adapt the provided box-shadow with the inset prefix.
boxShadow . pure . bsInset
bsColor :: Color -> BoxShadow -> BoxShadow infixr 9 Source #
Supply a color to the provided box-shadow.
Deprecated
The old implementation was both restrictive and slightly off-spec. It
shall be discontinued in a future release. The boxShadow name has already
been taken, so the functionality that used to provide is now provided by
'boxShadow''.
boxShadow' :: Size a -> Size a -> Size a -> Color -> Css Source #
Deprecated: This function is only present for compatibility purposes and will be removed.
This is the drop-in replacement for the old boxShadow function (< 0.13).
It is possible to continue for now
boxShadowWithSpread :: Size a -> Size a -> Size a -> Size a -> Color -> Css Source #
Deprecated: This function has been replaced with shadowWithSpread and bsColor and will be removed.
Replace calls to this function as follows (using -XOverloadedLists)
boxShadowWithSpread x y rb rs c
boxShadow [c `bsColor` shadowWithSpread x y rb rs]
boxShadows :: [(Size a, Size a, Size a, Color)] -> Css Source #
Deprecated: This function is replaced with boxShadow and will be removed.
Replace calls to this function as follows (using -XOverloadedLists)
boxShadows [(x1, y1, rb1, c1), (x2, y2, rb2, c2)]
boxShadow [ c1 `bsColor` shadowWithBlur x1 y1 rb1 , c2 `bsColor` shadowWithBlur x2 y2 rb2 ]
insetBoxShadow :: Stroke -> Size a -> Size a -> Size a -> Color -> Css Source #
Deprecated: This function has been replaced with shadowWithSpread, bsInset and bsColor and will be removed.
Replace calls to this function as follows (using -XOverloadedLists)
insetBoxShadow s x y rb c
boxShadow [bsInset $ c `bsColor` shadowWithBlur x y rb]