Sabberworm\CSS\RuleSet\DeclarationBlock
Declaration blocks are the parts of a css file which denote the rules belonging to a selector.
Declaration blocks usually appear directly inside a Document or another CSSList (mostly a MediaQuery).
Synopsis
class DeclarationBlock
extends RuleSet
{
- // members
- private $aSelectors;
- // Inherited members from RuleSet
- protected $iLineNo;
- protected $aComments;
- // methods
- public void __construct()
- public void setSelectors()
- public void removeSelector()
- public void getSelector()
- public void setSelector()
- public void getSelectors()
- public void expandShorthands()
- public void createShorthands()
- public void expandBorderShorthand()
- public void expandDimensionsShorthand()
- public void expandFontShorthand()
- public void expandBackgroundShorthand()
- public void expandListStyleShorthand()
- public void createShorthandProperties()
- public void createBackgroundShorthand()
- public void createListStyleShorthand()
- public void createBorderShorthand()
- public void createDimensionsShorthand()
- public void createFontShorthand()
- public void __toString()
- public void render()
- // Inherited methods from RuleSet
- public void __construct()
- public int getLineNo()
- public void addRule()
- public void getRules()
- public void setRules()
- public void getRulesAssoc()
- public void removeRule()
- public void __toString()
- public void render()
- public void addComments()
- public array getComments()
- public void setComments()
Hierarchy
Extends
Members
private
- $aSelectors
protected
- $aComments
- $iLineNo
Methods
public
- __construct()
- __toString()
- createBackgroundShorthand()
- createBorderShorthand() — Combine border-color, border-style and border-width into border Should be run after create_dimensions_shorthand!
- createDimensionsShorthand()
- createFontShorthand() — Looks for long format CSS font properties (e.g. <tt>font-weight</tt>) and tries to convert them into a shorthand CSS <tt>font</tt> property.
- createListStyleShorthand()
- createShorthandProperties()
- createShorthands() — Create shorthand declarations (e.g. +margin+ or +font+) whenever possible.
- expandBackgroundShorthand()
- expandBorderShorthand() — Split shorthand border declarations (e.g. <tt>border: 1px red;</tt>) Additional splitting happens in expandDimensionsShorthand Multiple borders are not yet supported as of 3
- expandDimensionsShorthand() — Split shorthand dimensional declarations (e.g. <tt>margin: 0px auto;</tt>) into their constituent parts.
- expandFontShorthand() — Convert shorthand font declarations (e.g. <tt>font: 300 italic 11px/14px verdana, helvetica, sans-serif;</tt>) into their constituent parts.
- expandListStyleShorthand()
- expandShorthands() — Split shorthand declarations (e.g. +margin+ or +font+) into their constituent parts.
- getSelector()
- getSelectors()
- removeSelector()
- render()
- setSelector()
- setSelectors()
Inherited from Sabberworm\CSS\RuleSet\RuleSet
public
- __toString()
- addComments()
- addRule()
- getComments()
- getLineNo()
- getRules() — Returns all rules matching the given rule name
- getRulesAssoc() — Returns all rules matching the given pattern and returns them in an associative array with the rule’s name as keys. This method exists mainly for backwards-compatibility and is really only partially useful.
- removeRule() — Remove a rule from this RuleSet. This accepts all the possible values that @link{getRules()} accepts. If given a Rule, it will only remove this particular rule (by identity). If given a name, it will remove all rules by that name. Note: this is different from pre-v.2.0 behaviour of PHP-CSS-Parser, where passing a Rule instance would remove all rules with the same name. To get the old behvaiour, use removeRule($oRule->getRule()).
- render()
- setComments()
- setRules() — Override all the rules of this set.