Skip to content

Commit c7793d9

Browse files
author
Adam Argyle
committed
[css-nesting] added a :not, :is, and && error sample
1 parent e1dc34d commit c7793d9

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

css-nesting-1/Overview.bs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,20 @@ Direct Nesting {#direct}
225225
:is(.foo, .bar) + .baz,
226226
:is(.foo, .bar).qux { color: red; }
227227
*/
228+
229+
ul, ol {
230+
&:not(.foo,.bar) > .baz { color: red; }
231+
}
232+
/* equivalent to
233+
:is(ul,ol):not(.foo,.bar) > .baz { color: red; }
234+
*/
235+
236+
.foo {
237+
&:is(.bar, &.baz) { color: red; }
238+
}
239+
/* equivalent to
240+
.foo:is(.bar, .foo:is(.baz)) { color: red; }
241+
*/
228242
</pre>
229243

230244
But the following are invalid:
@@ -248,6 +262,12 @@ Direct Nesting {#direct}
248262
}
249263
/* Invalid because the second selector in the list doesn't
250264
contain a nesting selector. */
265+
266+
.foo {
267+
color: red;
268+
&&.bar { color: blue; }
269+
}
270+
/* Invalid because the 1st & isn't at the start of the selector */
251271
</pre>
252272
</div>
253273

0 commit comments

Comments
 (0)