postcss-selector-matches
postcss-selector-matches copied to clipboard
PostCSS plugin to transform :matches() W3C CSS pseudo class to more compatible CSS (simpler selectors)
Fairly significant news: https://github.com/w3c/csswg-drafts/issues/1027 **UPDATED: May 31, 2018** The CSSWG has resolved 2 issues with `:matches()`. ### 1. Matches uses the hierarchy of the entire document The matches the behavior...
``` css .class { &:matches(element) { property: value; } } ``` produces: ``` css .classelement { property: value; } ``` when it _should_ produce: ``` css element.class { property: value;...
[`postcss-selector-parser`](https://github.com/postcss/postcss-selector-parser) has been made with the goal of improving the handling of css selectors in postcss plugins by making sure to avoid outputting broken selectors (see #7, #14, #16). [](https://www.npmjs.com/package/postcss-selector-parser)
Related to #7. Example: ```css foo:matches(*) { } ``` This should compile to ```css foo { } ``` But instead it compiles to ```css foo* { } ```