clay-0.0.1: CSS preprocessor as embedded Haskell.

Safe HaskellNone

Clay.Stylesheet

Synopsis

Documentation

newtype MediaType Source

Constructors

MediaType Value 

data NotOrOnly Source

Constructors

Not 
Only 

data Feature Source

Constructors

Feature Text (Maybe Value) 

data Rule Source

Constructors

Property (Key ()) Value 
Nested App [Rule] 
Query MediaQuery [Rule] 

newtype StyleM a Source

Constructors

S (Writer [Rule] a) 

Instances

type Css = StyleM ()Source

The Css context is used to collect style rules which are mappings from selectors to style properties. The Css type is a computation in the StyleM monad that just collects and doesn't return anything.

key :: Val a => Key a -> a -> CssSource

Add a new style property to the stylesheet with the specified Key and value. The value can be any type that is in the Val typeclass, with other words: can be converted to a Value.

prefixed :: Val a => Prefixed -> a -> CssSource

Add a new style property to the stylesheet with the specified Key and value, like key but use a Prefixed key.

(-:) :: Key Text -> Text -> CssSource

The colon operator can be used to add style rules to the current context for which there is no embedded version available. Both the key and the value are plain text values and rendered as is to the output CSS.

(?) :: Selector -> Css -> CssSource

Assign a stylesheet to a selector. When the selector is nested inside an outer scope it will be composed with deep.

(<?) :: Selector -> Css -> CssSource

Assign a stylesheet to a selector. When the selector is nested inside an outer scope it will be composed with |>.

(&) :: Refinement -> Css -> CssSource

Assign a stylesheet to a filter selector. When the selector is nested inside an outer scope it will be composed with the with selector.

root :: Selector -> Css -> CssSource

Root is used to add style rules to the top scope.

pop :: Int -> Css -> CssSource

Pop is used to add style rules to selectors defined in an outer scope. The counter specifies how far up the scope stack we want to add the rules.

query :: MediaType -> [Feature] -> Css -> CssSource

Apply a set of style rules when the media type and feature queries apply.

queryNot :: MediaType -> [Feature] -> Css -> CssSource

Apply a set of style rules when the media type and feature queries do not apply.

queryOnly :: MediaType -> [Feature] -> Css -> CssSource

Apply a set of style rules only when the media type and feature queries apply.