clay-0.13.2: CSS preprocessor as embedded Haskell.

Safe HaskellNone
LanguageHaskell98

Clay.Box

Contents

Synopsis

Documentation

data BoxType Source #

Instances
Val BoxType Source # 
Instance details

Defined in Clay.Box

Methods

value :: BoxType -> Value Source #

Inherit BoxType Source # 
Instance details

Defined in Clay.Box

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 {--} for the simplest list syntax.

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

shadow Source #

Arguments

:: Size a

Horizontal offset

-> Size a

Vertical offset

-> BoxShadow 

shadowWithBlur Source #

Arguments

:: Size a

Horizontal offset

-> Size a

Vertical offset

-> Size a

Blur radius

-> BoxShadow 

shadowWithSpread Source #

Arguments

:: Size a

Horizontal offset

-> Size a

Vertical offset

-> Size a

Blur radius

-> Size a

Spread radius

-> BoxShadow 

While this function is the correct type to work with the sym, sym2 or sym3 functions, such applications are unlikely to be meaningful.

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]