Sabberworm\CSS\Property\Selector
Class representing a single CSS selector. Selectors have to be split by the comma prior to being passed into this class.
Synopsis
class Selector
{
- // constants
- const 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';
- const ELEMENTS_AND_PSEUDO_ELEMENTS_RX = '/ ((^|[\s\+\>\~]+)[\w]+ # elements | \:{1,2}( # pseudo-elements after|before|first-letter|first-line|selection )) /ix';
- // members
- private $sSelector;
- private $iSpecificity;
- // methods
- public void __construct()
- public void getSelector()
- public void setSelector()
- public void __toString()
- public void getSpecificity()
Constants
Name | Value |
---|---|
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' |
ELEMENTS_AND_PSEUDO_ELEMENTS_RX | '/ ((^|[\s\+\>\~]+)[\w]+ # elements | \:{1,2}( # pseudo-elements after|before|first-letter|first-line|selection )) /ix' |
Members
private
- $iSpecificity
- $sSelector