niagra-0.0.1: CSS EDSL for Haskell

Copyright(c) Nathaniel Symer, 2015
LicenseMIT
Maintainernate@symer.io
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe
LanguageHaskell2010

Data.Niagra.Selector

Contents

Description

Create & manipulate CSS selectors.

Synopsis

Types

Builder

Operators

(<||>) :: Selector -> Selector -> Selector infixl 4 Source

Add aspect operator. Used to construct larger selectors from smaller ones. Often types, Selectors are constructed with the first argument set to Null, eg Class Null "myclass". You can use this operator to create a selector like this: h2.myclass by doing something like (Raw "h2") <||> (Class Null "myclass") (which is equivalent to Class (Raw "h2") "myclass").

Selector Operators

(.>.) infixl 5 Source

Arguments

:: Selector

parent

-> Selector

child

-> Selector 

Child selector.

(.+.) infixl 5 Source

Arguments

:: Selector

first sibling

-> Selector

second sibling

-> Selector 

immediate precedence.

(.~.) infixl 5 Source

Arguments

:: Selector

first selector

-> Selector

second selector

-> Selector 

Match a pair of contiguous selectors.

(#) infixl 4 Source

Arguments

:: Selector

Selector to add id to

-> Text

id

-> Selector 

Add an id to a Selector.

(!) infixl 4 Source

Arguments

:: Selector

Selector to add class to

-> Text

class

-> Selector 

Add a class to a Selector.

(<:>) infixl 4 Source

Arguments

:: Selector

Selector to add pseudoclass to

-> Text

pseudoclass

-> Selector 

Add a pseudoclass to a Selector. Does not allow for a parenthetial statement to be written as part of the pseudoclass.

(<::>) infixl 4 Source

Arguments

:: Selector

Selector to add pseudotype to

-> Text

pseudotype

-> Selector 

Add a pseudotype to a Selector. Does not allow for a parenthetial statement to be written as part of the pseudoclass.

Attribute Operators

(|=|) infixl 3 Source

Arguments

:: Text

attribute name

-> Text

desired value to test for equality

-> Selector 

Equality.

(|~=|) infixl 3 Source

Arguments

:: Text

attribute name

-> Text

value to be found in whitespace-separated list

-> Selector 

Whitespace-separated list contains.

(||=|) infixl 3 Source

Arguments

:: Text

attribute name

-> Text

value to be found in hyphen-separated list

-> Selector 

Hyphen-separated list contains.

(|^=|) infixl 3 Source

Arguments

:: Text

attribute name

-> Text

string beginning

-> Selector 

Begins with.

(|$=|) infixl 3 Source

Arguments

:: Text

attribute name

-> Text

string ending

-> Selector 

Ends with.

(|*=|) infixl 3 Source

Arguments

:: Text

attribute name

-> Text

substring in attribute

-> Selector 

Substring.

cls Source

Arguments

:: Text

name of the class

-> Selector 

Create a CSS class.

ident Source

Arguments

:: Text

name of the id

-> Selector 

Create an CSS id.

pseudoClass Source

Arguments

:: Text

the name of the pseudoclass

-> Maybe Selector

maybe a parenthetical statement to follow the pseudoclass

-> Selector 

Create a pseudoclass.

pseudoType Source

Arguments

:: Text

the name of the pseudotype

-> Maybe Selector

maybe a parenthetical statement to follow the pseudotype

-> Selector 

Create a pseudotype.