◆ __toString()
| Sabberworm\CSS\RuleSet\DeclarationBlock::__toString |
( |
| ) |
|
◆ addComments()
| Sabberworm\CSS\RuleSet\RuleSet::addComments |
( |
array | $aComments | ) |
|
|
inherited |
◆ addRule()
| Sabberworm\CSS\RuleSet\RuleSet::addRule |
( |
Rule | $oRule, |
|
|
Rule | $oSibling = null ) |
|
inherited |
◆ createBackgroundShorthand()
| Sabberworm\CSS\RuleSet\DeclarationBlock::createBackgroundShorthand |
( |
| ) |
|
◆ createBorderShorthand()
| Sabberworm\CSS\RuleSet\DeclarationBlock::createBorderShorthand |
( |
| ) |
|
Combines border-color, border-style and border-width into border.
Should be run after create_dimensions_shorthand!
- Return values
-
◆ createDimensionsShorthand()
| Sabberworm\CSS\RuleSet\DeclarationBlock::createDimensionsShorthand |
( |
| ) |
|
Looks for long format CSS dimensional properties (margin, padding, border-color, border-style and border-width) and converts them into shorthand CSS properties.
- Return values
-
◆ createFontShorthand()
| Sabberworm\CSS\RuleSet\DeclarationBlock::createFontShorthand |
( |
| ) |
|
Looks for long format CSS font properties (e.g.
font-weight) and tries to convert them into a shorthand CSS font property.
At least font-size AND font-family must be present in order to create a shorthand declaration.
- Return values
-
◆ createListStyleShorthand()
| Sabberworm\CSS\RuleSet\DeclarationBlock::createListStyleShorthand |
( |
| ) |
|
◆ createShorthandProperties()
| Sabberworm\CSS\RuleSet\DeclarationBlock::createShorthandProperties |
( |
array | $aProperties, |
|
|
| $sShorthand ) |
- Parameters
-
| array<array-key,string> | $aProperties |
| string | $sShorthand | |
- Return values
-
◆ createShorthands()
| Sabberworm\CSS\RuleSet\DeclarationBlock::createShorthands |
( |
| ) |
|
Creates shorthand declarations (e.g.
margin or font) whenever possible.
- Return values
-
◆ expandBackgroundShorthand()
| Sabberworm\CSS\RuleSet\DeclarationBlock::expandBackgroundShorthand |
( |
| ) |
|
◆ expandBorderShorthand()
| Sabberworm\CSS\RuleSet\DeclarationBlock::expandBorderShorthand |
( |
| ) |
|
Splits shorthand border declarations (e.g.
border: 1px red;).
Additional splitting happens in expandDimensionsShorthand.
Multiple borders are not yet supported as of 3.
- Return values
-
◆ expandDimensionsShorthand()
| Sabberworm\CSS\RuleSet\DeclarationBlock::expandDimensionsShorthand |
( |
| ) |
|
Splits shorthand dimensional declarations (e.g.
margin: 0px auto;) into their constituent parts.
Handles margin, padding, border-color, border-style and border-width.
- Return values
-
◆ expandFontShorthand()
| Sabberworm\CSS\RuleSet\DeclarationBlock::expandFontShorthand |
( |
| ) |
|
Converts shorthand font declarations (e.g.
font: 300 italic 11px/14px verdana, helvetica, sans-serif;) into their constituent parts.
- Return values
-
◆ expandListStyleShorthand()
| Sabberworm\CSS\RuleSet\DeclarationBlock::expandListStyleShorthand |
( |
| ) |
|
◆ expandShorthands()
| Sabberworm\CSS\RuleSet\DeclarationBlock::expandShorthands |
( |
| ) |
|
Splits shorthand declarations (e.g.
margin or font) into their constituent parts.
- Return values
-
◆ getComments()
| Sabberworm\CSS\RuleSet\RuleSet::getComments |
( |
| ) |
|
|
inherited |
◆ getLineNo()
| Sabberworm\CSS\RuleSet\RuleSet::getLineNo |
( |
| ) |
|
|
inherited |
◆ getRulesAssoc()
| Sabberworm\CSS\RuleSet\RuleSet::getRulesAssoc |
( |
| $mRule = null | ) |
|
|
inherited |
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.
Note: This method loses some information: Calling this (with an argument of background-) on a declaration block like { background-color: green; background-color; rgba(0, 127, 0, 0.7); } will only yield an associative array containing the rgba-valued rule while getRules() would yield an indexed array containing both.
- Parameters
-
| Rule | string | null | $mRule | $mRule Pattern to search for. If null, returns all rules. If the pattern ends with a dash, all rules starting with the pattern are returned as well as one matching the pattern with the dash excluded. Passing a Rule behaves like calling getRules($mRule->getRule()). |
- Return values
-
◆ getSelector()
| Sabberworm\CSS\RuleSet\DeclarationBlock::getSelector |
( |
| ) |
|
- Return values
-
| array<int,Selector|string> | |
- Deprecated
- will be removed in version 9.0; use
getSelectors() instead
◆ getSelectors()
| Sabberworm\CSS\RuleSet\DeclarationBlock::getSelectors |
( |
| ) |
|
- Return values
-
| array<int,Selector|string> | |
◆ parse()
| static Sabberworm\CSS\RuleSet\DeclarationBlock::parse |
( |
ParserState | $oParserState, |
|
|
| $oList = null ) |
|
static |
- Parameters
-
- Return values
-
- Exceptions
-
| UnexpectedTokenException | |
| UnexpectedEOFException | |
◆ parseRuleSet()
| static Sabberworm\CSS\RuleSet\RuleSet::parseRuleSet |
( |
ParserState | $oParserState, |
|
|
RuleSet | $oRuleSet ) |
|
staticinherited |
- Return values
-
- Exceptions
-
| UnexpectedTokenException | |
| UnexpectedEOFException | |
◆ removeRule()
| Sabberworm\CSS\RuleSet\RuleSet::removeRule |
( |
| $mRule | ) |
|
|
inherited |
Removes a rule from this RuleSet.
This accepts all the possible values that 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 behaviour, use removeRule($oRule->getRule()).
- Parameters
-
| Rule | string | null | $mRule | pattern to remove. If $mRule is null, all rules are removed. If the pattern ends in a dash, all rules starting with the pattern are removed as well as one matching the pattern with the dash excluded. Passing a Rule behaves matches by identity. |
- Return values
-
◆ removeSelector()
| Sabberworm\CSS\RuleSet\DeclarationBlock::removeSelector |
( |
| $mSelector | ) |
|
Remove one of the selectors of the block.
- Parameters
-
| Selector | string | $mSelector | |
- Return values
-
◆ render()
| Sabberworm\CSS\RuleSet\DeclarationBlock::render |
( |
OutputFormat | $oOutputFormat | ) |
|
◆ setComments()
| Sabberworm\CSS\RuleSet\RuleSet::setComments |
( |
array | $aComments | ) |
|
|
inherited |
◆ setRules()
| Sabberworm\CSS\RuleSet\RuleSet::setRules |
( |
array | $aRules | ) |
|
|
inherited |
Overrides all the rules of this set.
- Parameters
-
| array<array-key,Rule> | $aRules The rules to override with. |
- Return values
-
◆ setSelector()
| Sabberworm\CSS\RuleSet\DeclarationBlock::setSelector |
( |
| $mSelector, |
|
|
| $oList = null ) |
- Parameters
-
| Selector | string | $mSelector | |
| CSSList | null | $oList | |
- Return values
-
- Deprecated
- will be removed in version 9.0; use
setSelectors() instead
◆ setSelectors()
| Sabberworm\CSS\RuleSet\DeclarationBlock::setSelectors |
( |
| $mSelector, |
|
|
| $oList = null ) |
- Parameters
-
| array<int,Selector|string>|string | $mSelector |
| CSSList | null | $oList | |
- Exceptions
-
The documentation for this class was generated from the following file:
- lib/php-css-parser/RuleSet/DeclarationBlock.php