PHP-CSS-Parser
PHP-CSS-Parser copied to clipboard
Required trailing space after ` or ` conditional within at-rule is removed
My origin CSS has some @supports
at-rules, and inside the conditional statement of these rules there are some or
statements, for example:
@supports ((-webkit-transform-style:preserve-3d) or (transform-style:preserve-3d)){}
When I run the following code (assuming $originalStyleContent contains a string of CSS being processed) the space that follows the or
operator is missing:
$cssParser = new Sabberworm\CSS\Parser($originalStyleContent);
$originCSS=$cssParser->parse();
$outputString.=$originCSS->render(Sabberworm\CSS\OutputFormat::createCompact());
results in...
@supports ((-webkit-transform-style:preserve-3d) or(transform-style:preserve-3d)){}
Maybe I'm wrong (because my knowledge of CSS does have it's limits) but this missing space seems to be the culprit behind other operations on my development environment not being able to parse the resulting CSS. Can you confirm that this missing space is in fact necessary and needs to be present post-render?
It’s possible we falsely parse or (transform-style:preserve-3d)
as a function but I’m not sure as I don’t know the code path used for @supports
, will need to investigate.