-
Notifications
You must be signed in to change notification settings - Fork 147
Open
Labels
Description
$input = <<<CSS
a {
/* margin: 10px 10px 10px 0; */
outline: none;
}
CSS;
$document = (new \Sabberworm\CSS\Parser($input))
->parse();
$format = OutputFormat::createPretty();
echo $document->render($format);becomes:
a {
/* margin: 10px 10px 10px 0; */
outline: none;
}while if you update the input to remove the outline property,
a {
/* margin: 10px 10px 10px 0; */
}it becomes:
a {}so any commented rule(s) not followed by a CSS rule are removed from the resulting rule set.
Problem occurs here because getRules() returns an empty array
PHP-CSS-Parser/src/RuleSet/RuleSet.php
Line 308 in 0ae1fde
| foreach ($this->getRules() as $rule) { |