postcss-pseudo-classes
postcss-pseudo-classes copied to clipboard
ignore :is pseudoclass as parentheses can contain unhandled spaces and further pseudoclasses
- when
:iswas escaped, the space within the brackets was not escaped and we got a unusable class ofa\:is\(.\:hover, .current), which also has an unescaped closing bracket - IMO without
allCombinationsit's reasonable to expect the:isto be maintained as-is, so that explicit.\:hoverclasses can be programmatically added without having to add classes for each of the:isrules in the stylesheet, which is likely to be non-trivial given how this pseudoclass is used in the wild.
I've solved in this PR by blacklisting :is, but possibly there is a better solution out there which IMO would need to replicate some of the effect of allCombinations even in the absence of that option.
Example ideal solution, not implemented in this PR:
a:is(:hover, .current, .\:hover),
a.\:is\(\:hover\,\ \.current\) {
color: firebrick;
}
Above demonstrates recursive addition of new class within the 'sub selector' of the :is parenthesis, as well as proper escaping of a full :is statement (which I can't imagine anyone ever using)
This came about due to a test case from the following PR in another repository: https://github.com/rrweb-io/rrweb/pull/1535