fb55 / css-what

a CSS selector parser
BSD 2-Clause "Simplified" License
233 stars 45 forks source link

[Feature request] Support for forgiving selector parsing #1254

Open CatchABus opened 6 months ago

CatchABus commented 6 months ago

Right now, parser will throw even in the case of :is() pseudo-class that contains an invalid selector (even if there are other valid selectors).

That pseudo-class apparent accepts a forgiving selector list: https://developer.mozilla.org/en-US/docs/Web/CSS/:is#forgiving_selector_parsing

For example, in the following case css will still apply to valid selectors

:is(ol, ul, ??$#$@#) {
  color: green;
}
fb55 commented 4 months ago

This makes sense as a new option — PRs welcome!