clay-0.3: CSS preprocessor as embedded Haskell.

Safe HaskellNone

Clay.Selector

Synopsis

Documentation

star :: SelectorSource

The star selector applies to all elements. Maps to * in CSS.

element :: Text -> SelectorSource

Select elements by name. The preferred syntax is to enable OverloadedStrings and actually just use "element-name" or use one of the predefined elements from Clay.Elements.

deep :: Selector -> Selector -> SelectorSource

Named alias for **.

(**) :: Selector -> Selector -> SelectorSource

The deep selector composer. Maps to sel1 sel2 in CSS.

child :: Selector -> Selector -> SelectorSource

Named alias for |>.

(|>) :: Selector -> Selector -> SelectorSource

The child selector composer. Maps to sel1 > sel2 in CSS.

(|+) :: Selector -> Selector -> SelectorSource

The adjacent selector composer. Maps to sel1 + sel2 in CSS.

with :: Selector -> Refinement -> SelectorSource

Named alias for `#`.

(#) :: Selector -> Refinement -> SelectorSource

The filter selector composer, adds a filter to a selector. Maps to something like sel#filter or sel.filter in CSS, depending on the filter.

byId :: Text -> RefinementSource

Filter elements by id. The preferred syntax is to enable OverloadedStrings and use "#id-name".

byClass :: Text -> RefinementSource

Filter elements by class. The preferred syntax is to enable OverloadedStrings and use ".class-name".

pseudo :: Text -> RefinementSource

Filter elements by pseudo selector or pseudo class. The preferred syntax is to enable OverloadedStrings and use ":pseudo-selector" or use one of the predefined ones from Clay.Pseudo.

func :: Text -> [Text] -> RefinementSource

Filter elements by pseudo selector functions. The preferred way is to use one of the predefined functions from Clay.Pseudo.

attr :: Text -> RefinementSource

Filter elements based on the presence of a certain attribute. The preferred syntax is to enable OverloadedStrings and use "@attr" or use one of the predefined ones from Clay.Attributes.

(@=) :: Text -> Text -> RefinementSource

Filter elements based on the presence of a certain attribute with the specified value.

($=) :: Text -> Text -> RefinementSource

Filter elements based on the presence of a certain attribute that ends with the specified value.

(~=) :: Text -> Text -> RefinementSource

Filter elements based on the presence of a certain attribute that have the specified value contained in a space separated list.

(|=) :: Text -> Text -> RefinementSource

Filter elements based on the presence of a certain attribute that have the specified value contained in a hyphen separated list.

newtype Refinement Source

Constructors

Refinement 

Fields

unFilter :: [Predicate]
 

data Path f Source

Constructors

Star 
Elem Text 
Child f f 
Deep f f 
Adjacent f f 
Combined f f 

Instances

Show f => Show (Path f) 

newtype Fix f Source

Constructors

In 

Fields

out :: f (Fix f)
 

Instances

data SelectorF a Source

Constructors

SelectorF Refinement (Path a)