parcel-bundler / lightningcss

An extremely fast CSS parser, transformer, bundler, and minifier written in Rust.
https://lightningcss.dev
Mozilla Public License 2.0
6.31k stars 177 forks source link

Support all CSS `selectors-4` selectors #87

Open yisibl opened 2 years ago

yisibl commented 2 years ago

There are currently many selector tests that fail.

e.g. https://www.w3.org/TR/selectors-4/#the-nth-col-pseudo

:nth-col(odd) {
    width: 10px;
}

:nth-col(2n+1) {
    width: 20px;
}

:nth-last-col(odd) {
    width: 30px;
}

:nth-last-col(2n+1) {
    width: 40px;
}
devongovett commented 2 years ago

As far as I can tell, there are no browsers that implement these yet, and no way to polyfill them with pure CSS. So I don't feel too much rush at this point. Would be easy to add to the parser though if someone wants to go for it!