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

Support leading type selector in nesting #576

Closed
valtlai opened this issue Aug 31, 2023 · 0 comments
Closed

Support leading type selector in nesting #576

valtlai opened this issue Aug 31, 2023 · 0 comments

Comments

@valtlai
Copy link

valtlai commented Aug 31, 2023

Firefox 117 supports the following:

.foo {
  mark {
    background: lime;
  }

  main & {
    font-size: 2em;
  }
}

(CodePen demo)

Other browsers don’t currently support a nested selector starting with a symbol, so the nesting selector & or the :is() pseudo-class is needed:

.foo {
  & mark {
    background: lime;
  }

  :is(main) & {
    font-size: 2em;
  }
}

The CSSWG removed this restriction, but the other browser aren’t yet implemented/shipped this change.

Lightning CSS should apply these transformations, so the CSS authors can use a bare type selector at the start of the entire selector.

@valtlai valtlai changed the title Support leading element selector in nesting Support leading type selector in nesting Aug 31, 2023
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