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

[css-nesting] Meaning of using multiple & #6336

Closed
Loirooriol opened this issue Jun 1, 2021 · 1 comment
Closed

[css-nesting] Meaning of using multiple & #6336

Loirooriol opened this issue Jun 1, 2021 · 1 comment
Labels
css-nesting-1 Current Work

Comments

@Loirooriol
Copy link
Contributor

div {
  @nest & > & {
    color: blue;
  }
}

What's the meaning of this? Does it match all div element which are a child of another div element, just like

div > div { color: blue }

Or does it only match the div elements which are a child of themselves (i.e. match nothing)?

@Loirooriol Loirooriol added the css-nesting-1 Current Work label Jun 1, 2021
@Loirooriol
Copy link
Contributor Author

OK, I missed this example from the spec:

.foo {
  color: blue;
  & .bar & .baz & .qux { color: red; }
}
/* equivalent to
   .foo { color: blue; }
   .foo .bar .foo .baz .foo .qux { color: red; }
 */

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-nesting-1 Current Work
Projects
None yet
Development

No branches or pull requests

1 participant