Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
spiralx
on July 29, 2022
|
parent
|
context
|
favorite
| on:
Help pick a syntax for CSS nesting
But the example with multiple selectors and & at the start is unclear due to the precedence of the @nest operator over the comma:
/* @nest always */ @nest & + .baz, &.qux { color: red; }
It's clearer perhaps with different nesting, but that's fragile and a pain:
/* @nest always */ @nest & + .baz, &.qux { color: red; }
At least with option 1 you only end up with this issue in the uncommon case of multiple selectors
and
a non-leading &.
/* @nest */ & + .baz, &.qux { color: red; }
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: