Skip to content

Commit b77c58b

Browse files
committed
[css-nesting-1] add additional example for nested conditionals
1 parent 87883c3 commit b77c58b

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

css-nesting-1/Overview.bs

+32
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,38 @@ Nesting Conditional Rules {#conditionals}
465465
}
466466
*/
467467

468+
.foo {
469+
display: grid;
470+
471+
@media (orientation: landscape) {
472+
& {
473+
grid-auto-flow: column;
474+
}
475+
476+
@media (min-inline-size > 1024px) {
477+
& {
478+
max-inline-size: 1024px;
479+
}
480+
}
481+
}
482+
}
483+
484+
/* equivalent to
485+
.foo { display: grid; }
486+
487+
@media (orientation: landscape) {
488+
.foo {
489+
grid-auto-flow: column;
490+
}
491+
}
492+
493+
@media (orientation: landscape) and (min-inline-size > 1024px) {
494+
.foo {
495+
max-inline-size: 1024px;
496+
}
497+
}
498+
*/
499+
468500
.foo {
469501
color: red;
470502

0 commit comments

Comments
 (0)