New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merging of rules with unprefixed pseudo-classes #390
Comments
As mentioned in the PR, there are a few more of these cases. Here's a script to test a browser for support: var selectors = [
":active", ":checked", ":default", ":dir(ltr)", ":disabled", ":empty", ":enabled",
":first", ":first-child", ":first-of-type", ":fullscreen", ":focus", ":hover",
":indeterminate", ":in-range", ":invalid", ":lang(en)", ":last-child",
":last-of-type", ":left", ":link", ":not(.class)", ":nth-child(1)",
":nth-last-child(1)", ":nth-last-of-type(1)", ":nth-of-type(1)", ":only-child",
":only-of-type", ":optional", ":out-of-range", ":read-only", ":read-write",
":required", ":right", ":root", ":scope", ":target", ":valid", ":visited"
]
var style = document.createElement("style");
style.appendChild(document.createTextNode(""));
document.head.appendChild(style);
selectors.forEach(function (selector) {
var valid = true;
try {
style.sheet.insertRule(selector + "{color:red}", 0);
} catch (err) {
valid = false;
}
console.log(selector + " " + (valid ? "yes" : "no"));
}); |
Ran the script on Firefox, Chrome and Safari:
So I think I'd have to add all these to the regexp. Should I go ahead? |
Just did the same. :-) Please add all from the list in a separate commit. Well done! 💯 |
silverwind
added a commit
to silverwind/clean-css
that referenced
this issue
Dec 1, 2014
silverwind
added a commit
to silverwind/clean-css
that referenced
this issue
Dec 2, 2014
silverwind
added a commit
to silverwind/clean-css
that referenced
this issue
Dec 2, 2014
silverwind
added a commit
to silverwind/clean-css
that referenced
this issue
Dec 2, 2014
silverwind
added a commit
to silverwind/clean-css
that referenced
this issue
Dec 2, 2014
jakubpawlowicz
added a commit
that referenced
this issue
Dec 2, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is probably a bit of a corner case, but in advanced mode,
will get merged into
The merged rule is considered invalid (because no browser supports unprefixed :fullscreen yet) and the
a
style ist dropped by browsers. I noticed that a:-moz-full-screen
wasn't getting merged, so maybe that same treatment could be useful in this case too.The text was updated successfully, but these errors were encountered: