File tree Expand file tree Collapse file tree 1 file changed +75
-0
lines changed Expand file tree Collapse file tree 1 file changed +75
-0
lines changed Original file line number Diff line number Diff line change @@ -427,6 +427,81 @@ Syntax {#syntax}
427
427
figure > figcaption { background: hsl(0 0% 0% / 50%); }
428
428
figure > figcaption > p { font-size: .9rem; }
429
429
*/
430
+
431
+ <b> /* Example usage with Cascade Layers */</b>
432
+ @layer base {
433
+ html {
434
+ block-size: 100%;
435
+
436
+ & body {
437
+ min-block-size: 100%;
438
+ }
439
+ }
440
+ }
441
+ /* equivalent to
442
+ @layer base {
443
+ html { block-size: 100%; }
444
+ html body { min-block-size: 100%; }
445
+ }
446
+ */
447
+
448
+ <b> /* Example nesting Cascade Layers */</b>
449
+ @layer base {
450
+ html {
451
+ block-size: 100%;
452
+
453
+ @layer base.support {
454
+ & body {
455
+ min-block-size: 100%;
456
+ }
457
+ }
458
+ }
459
+ }
460
+ /* equivalent to
461
+ @layer base {
462
+ html { block-size: 100%; }
463
+ }
464
+ @layer base.support {
465
+ html body { min-block-size: 100%; }
466
+ }
467
+ */
468
+
469
+ <b> /* Example usage with Scoping */</b>
470
+ @scope (.card) to (> header) { {
471
+ :scope {
472
+ inline-size: 40ch;
473
+ aspect-ratio: 3/4;
474
+
475
+ > header {
476
+ border-block-end: 1px solid white;
477
+ }
478
+ }
479
+ }
480
+ /* equivalent to
481
+ @scope (.card) to (> header) {
482
+ :scope { inline-size: 40ch; aspect-ratio: 3/4; }
483
+ :scope > header { border-block-end: 1px solid white; }
484
+ }
485
+ */
486
+
487
+ <b> /* Example nesting Scoping */</b>
488
+ .card {
489
+ inline-size: 40ch;
490
+ aspect-ratio: 3/4;
491
+
492
+ @scope (&) to (> header > *) {
493
+ :scope > header {
494
+ border-block-end: 1px solid white;
495
+ }
496
+ }
497
+ }
498
+
499
+ /* equivalent to
500
+ .card { inline-size: 40ch; aspect-ratio: 3/4; }
501
+ @scope (.card) to (> header > *) {
502
+ :scope > header { border-block-end: 1px solid white; }
503
+ }
504
+ */
430
505
</pre>
431
506
432
507
But these are not valid:
You can’t perform that action at this time.
0 commit comments