-
Notifications
You must be signed in to change notification settings - Fork 756
Closed
Labels
css-nesting-1Current WorkCurrent Work
Description
CSS Nesting avoids unbounded lookahead to tell whether a given bit of text is a declaration or the start of a style rule by requiring a single token of lookahead in its parsing. These tokens are either the <delim-token> or <at-keyword-token>. More specifically, the <delim-token> must have a value of &, and the <at-keyword-token> must have a value of nest.
May we expand the allowable value of the <delim-token> to include non-& values for descendant nesting?
Before this proposed change, here is a sample of allowable CSS (from CSS Nesting: Example 4):
.foo {
color: blue;
& > .bar { color: red; }
}
.foo, .bar {
color: blue;
& + .baz, &.qux { color: red; }
}
.foo {
color: blue;
& .bar, & .baz, & .qux { color: red; }
}After this proposed change, here is an updated sample of allowable CSS:
.foo {
color: blue;
> .bar { color: red; }
}
.foo, .bar {
color: blue;
+ .baz, &.qux { color: red; }
}
.foo {
color: blue;
.bar, .baz, .qux { color: red; }
}This would further align syntactically-allowable CSS nesting with existing user-land CSS nesting (e.g. Stylis, Sass).
StephenHaney, hadihallak, colmtuite, peduarte and ByteEater-pl
Metadata
Metadata
Assignees
Labels
css-nesting-1Current WorkCurrent Work