Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Syntax of CSS3 selectors.
- data SelectorGroup = SelectorGroup Selector [Selector]
- data Selector = Selector SimpleSelectorSequence (Maybe (Combinator, Selector))
- data SimpleSelectorSequence = SimpleSelectorSequence HeadSimpleSelector [TailSimpleSelector]
- data HeadSimpleSelector
- data TailSimpleSelector
- data Combinator
- data AttributeOperator
- data PseudoClass
- data PseudoClassParameter = PseudoClassParameter Integer Integer
- data Specificity = Specificity !Int !Int !Int
- specificity :: Selector -> Specificity
Documentation
data SelectorGroup Source #
sel [, sel ...]
data HeadSimpleSelector Source #
data TailSimpleSelector Source #
AttributeSelector String (Maybe (AttributeOperator, String)) |
|
ClassSelector String | .class |
IDSelector String | #id |
PseudoClass PseudoClass | :pseudo-class |
data Combinator Source #
Descendant | E F |
Child | E > F |
AdjacentSibling | E + F |
GeneralSibling | E ~ F |
data AttributeOperator Source #
ExactMatch | A = V |
IncludesMatch | A ~= V |
DashMatch | A |= V |
PrefixMatch | A ^= V |
SuffixMatch | A $= V |
InfixMatch | A *= V |
data PseudoClass Source #
Root | |
NthChild PseudoClassParameter | |
NthLastChild PseudoClassParameter | |
NthOfType PseudoClassParameter | |
NthLastOfType PseudoClassParameter | |
FirstChild | |
LastChild | |
FirstOfType | |
LastOfType | |
OnlyChild | |
OnlyOfType | |
Empty | |
Not (Either HeadSimpleSelector TailSimpleSelector) | Note: According to the specs, |
data PseudoClassParameter Source #
data Specificity Source #
The specificity of a selector with its components decreasing in significance from left to
right. The components in Specificity a b c
denote
a
: the number of ID selectors,b
: the number of class selectors, attribute selectors and pseudo-classes (not counting the:not
pseudo-class itself), andc
: the number of type selectors and pseudo-elements
as described in http://www.w3.org/TR/selectors/#specificity.
Specificity !Int !Int !Int |
specificity :: Selector -> Specificity Source #
Returns the specificity for a selector.