Selector
in package
Class representing a single CSS selector. Selectors have to be split by the comma prior to being passed into this class.
Table of Contents
- ELEMENTS_AND_PSEUDO_ELEMENTS_RX = '/ ((^|[\s\+\>\~]+)[\w]+ # elements | \:{1,2}( # pseudo-elements after|before|first-letter|first-line|selection )) /ix'
- NON_ID_ATTRIBUTES_AND_PSEUDO_CLASSES_RX = '/ (\.[\w]+) # classes | \[(\w+) # attributes | (\:( # pseudo classes link|visited|active |hover|focus |lang |target |enabled|disabled|checked|indeterminate |root |nth-child|nth-last-child|nth-of-type|nth-last-of-type |first-child|last-child|first-of-type|last-of-type |only-child|only-of-type |empty|contains )) /ix'
- $iSpecificity : mixed
- $sSelector : mixed
- __construct() : mixed
- __toString() : mixed
- getSelector() : mixed
- getSpecificity() : mixed
- setSelector() : mixed
Constants
ELEMENTS_AND_PSEUDO_ELEMENTS_RX
public
mixed
ELEMENTS_AND_PSEUDO_ELEMENTS_RX
= '/
((^|[\s\+\>\~]+)[\w]+ # elements
|
\:{1,2}( # pseudo-elements
after|before|first-letter|first-line|selection
))
/ix'
NON_ID_ATTRIBUTES_AND_PSEUDO_CLASSES_RX
public
mixed
NON_ID_ATTRIBUTES_AND_PSEUDO_CLASSES_RX
= '/
(\.[\w]+) # classes
|
\[(\w+) # attributes
|
(\:( # pseudo classes
link|visited|active
|hover|focus
|lang
|target
|enabled|disabled|checked|indeterminate
|root
|nth-child|nth-last-child|nth-of-type|nth-last-of-type
|first-child|last-child|first-of-type|last-of-type
|only-child|only-of-type
|empty|contains
))
/ix'
Properties
$iSpecificity
private
mixed
$iSpecificity
$sSelector
private
mixed
$sSelector
Methods
__construct()
public
__construct(mixed $sSelector[, mixed $bCalculateSpecificity = false ]) : mixed
Parameters
- $sSelector : mixed
- $bCalculateSpecificity : mixed = false
Return values
mixed —__toString()
public
__toString() : mixed
Return values
mixed —getSelector()
public
getSelector() : mixed
Return values
mixed —getSpecificity()
public
getSpecificity() : mixed
Return values
mixed —setSelector()
public
setSelector(mixed $sSelector) : mixed
Parameters
- $sSelector : mixed