File tree Expand file tree Collapse file tree 1 file changed +31
-1
lines changed Expand file tree Collapse file tree 1 file changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -458,12 +458,32 @@ Nesting Conditional Rules {#conditionals}
458458 /* equivalent to
459459 .foo { display: grid; }
460460
461- @media (orientation: portrait ) {
461+ @media (orientation: landscape ) {
462462 .foo {
463463 grid-auto-flow: column;
464464 }
465465 }
466466 */
467+
468+ .foo {
469+ color: red;
470+
471+ @media (min-width: 480px) {
472+ & > .bar,
473+ & > .baz {
474+ color: blue;
475+ }
476+ }
477+ }
478+ /* equivalent to
479+ .foo { color: red; }
480+
481+ @media (min-width: 480px) {
482+ .foo > :is(.bar, .baz) {
483+ color: blue;
484+ }
485+ }
486+ */
467487 </pre>
468488
469489 But the following are invalid:
@@ -487,6 +507,16 @@ Nesting Conditional Rules {#conditionals}
487507 }
488508 /* Invalid because not all selectors in the list
489509 contain a nesting selector */
510+
511+ .foo {
512+ color: red;
513+
514+ @nest @media (min-width: 480px) {
515+ & { color: blue; }
516+ }
517+ }
518+ /* Invalid because @nest expects a selector prelude,
519+ instead a conditional rule was provided */
490520 </pre>
491521 </div>
492522
You can’t perform that action at this time.
0 commit comments