Skip to content
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

Warning when :is() contains pseudo-elements #760

Open
yisibl opened this issue Jun 20, 2024 · 0 comments
Open

Warning when :is() contains pseudo-elements #760

yisibl opened this issue Jun 20, 2024 · 0 comments

Comments

@yisibl
Copy link
Contributor

yisibl commented Jun 20, 2024

input

.foo:is(::before) {
  color: green;
}

output

.foo:is() {
  color: green;
}

expected

Prints a warning:

Pseudo-elements are not valid within the :is() selector.

.foo:is(::before) {
  color: green;
}

This is also not valid in CSS nesting, so you should print a warning when the same situation is encountered when nesting.

This is a clear departure from the traditional CSS preprocessor(SCSS/Less), and as CSS nesting becomes more widely implemented in browsers, more and more authors will be confused(see #352), even developers of browser engines: https://issues.chromium.org/issues/40278599

So we should explicitly tell them that they can't write this way in browsers at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant