stylist-2.4.0.2: Apply CSS styles to a document tree.
Safe HaskellNone
LanguageHaskell2010

Data.CSS.Syntax.Selector

Description

Parses CSS selectors See parseSelectors

Synopsis

Documentation

data Selector Source #

A CSS "selector" indicating which elements should be effected by CSS.

Constructors

Element [SimpleSelector]

Selects a single element.

Child Selector [SimpleSelector]

Represents "a > b" operator.

Descendant Selector [SimpleSelector]

Represents "a b" operator.

Adjacent Selector [SimpleSelector]

Represents "a + b" operator.

Sibling Selector [SimpleSelector]

Represents "a ~ b" operator.

Instances

Instances details
Eq Selector Source # 
Instance details

Defined in Data.CSS.Syntax.Selector

Show Selector Source # 
Instance details

Defined in Data.CSS.Syntax.Selector

data SimpleSelector Source #

An individual test comprising a CSS stylesheet.

Constructors

Tag Text

Matches a tagname, e.g. "a"

Namespace Text 
Id Text

Matches the "id" attribute, e.g. "#header"

Class Text

Matches the "class" attribute, e.g. ".ad"

Property (Maybe Text) Text PropertyTest

Matches a specified property

Psuedoclass Text [Token]

Matches psuedoclasses provided by the caller (via a nameless property).

data PropertyTest Source #

How should a property be matched.

Constructors

Exists

Matches whether an attribute actually exists, e.g. "[title]"

Equals Text

Matches whether the attribute is exactly equal to the value, e.g. "="

Suffix Text

Matches whether attribute ends with the given value, e.g. "$="

Prefix Text

Matches whether attribute starts with the given value, e.g. "^="

Substring Text

Matches whether the attribute contains the given value, e.g. "*="

Include Text

Is one of the whitespace-seperated values the one specified? e.g. "~="

Dash Text

Matches whitespace seperated values, or their "-"-seperated prefixes. e.g. "|="

Callback PropertyFunc

Calls the given function to test this property.

Instances

Instances details
Eq PropertyTest Source # 
Instance details

Defined in Data.CSS.Syntax.Selector

Show PropertyTest Source # 
Instance details

Defined in Data.CSS.Syntax.Selector

Hashable PropertyTest Source # 
Instance details

Defined in Data.CSS.Style.Selector.Index

data PropertyFunc Source #

Caller-specified functions to extend property selection. Has incorrect Show/Eq implementations so this rare exception doesn't break things.

Constructors

PropertyFunc (String -> Bool) 

Instances

Instances details
Eq PropertyFunc Source # 
Instance details

Defined in Data.CSS.Syntax.Selector

Show PropertyFunc Source # 
Instance details

Defined in Data.CSS.Syntax.Selector

parseSelectors :: Parser [Selector] Source #

Parses a CSS selector.