@@ -388,29 +388,13 @@ Resolving Dependency Cycles</h3>
388
388
389
389
390
390
<!--
391
- UUUUUUUU UUUUUUUU iiii
392
- U::::::U U::::::U i::::i
393
- U::::::U U::::::U iiii
394
- UU:::::U U:::::UU
395
- U:::::U U:::::U ssssssssss iiiiiiinnnn nnnnnnnn ggggggggg ggggg
396
- U:::::D D:::::U ss::::::::::s i:::::in:::nn::::::::nn g:::::::::ggg::::g
397
- U:::::D D:::::Uss:::::::::::::s i::::in::::::::::::::nn g:::::::::::::::::g
398
- U:::::D D:::::Us::::::ssss:::::s i::::inn:::::::::::::::ng::::::ggggg::::::gg
399
- U:::::D D:::::U s:::::s ssssss i::::i n:::::nnnn:::::ng:::::g g:::::g
400
- U:::::D D:::::U s::::::s i::::i n::::n n::::ng:::::g g:::::g
401
- U:::::D D:::::U s::::::s i::::i n::::n n::::ng:::::g g:::::g
402
- U::::::U U::::::Ussssss s:::::s i::::i n::::n n::::ng::::::g g:::::g
403
- U:::::::UUU:::::::Us:::::ssss::::::si::::::i n::::n n::::ng:::::::ggggg:::::g
404
- UU:::::::::::::UU s::::::::::::::s i::::::i n::::n n::::n g::::::::::::::::g
405
- UU:::::::::UU s:::::::::::ss i::::::i n::::n n::::n gg::::::::::::::g
406
- UUUUUUUUU sssssssssss iiiiiiii nnnnnn nnnnnn gggggggg::::::g
407
- g:::::g
408
- gggggg g:::::g
409
- g:::::gg gg:::::g
410
- g::::::ggg:::::::g
411
- gg:::::::::::::g
412
- ggg::::::ggg
413
- gggggg
391
+ ██ ██ ███ ████████ ███ ███
392
+ ██ ██ ██ ██ ██ ██ ██ ██
393
+ ██ ██ ██ ██ ██ ██ ██ ██
394
+ ██ ██ ██ ██ ████████ ██ ██
395
+ ██ ██ █████████ ██ ██ ██ ██
396
+ ██ ██ ██ ██ ██ ██ ██ ██
397
+ ███ ██ ██ ██ ██ ███ ███
414
398
-->
415
399
416
400
@@ -568,6 +552,12 @@ Using Cascading Variables: the ''var()'' notation</h2>
568
552
does not match its declared grammar,
569
553
the declaration is <a>invalid at computed-value time</a> .
570
554
555
+ If a declaration,
556
+ once all ''var()'' functions are substituted in,
557
+ contains only a [=CSS-wide keyword=]
558
+ (and possibly whitespace),
559
+ its value is determined as if that keyword were its [=specified value=] all along.
560
+
571
561
<div class='example'>
572
562
For example,
573
563
the following usage is fine from a syntax standpoint,
@@ -589,6 +579,28 @@ Using Cascading Variables: the ''var()'' notation</h2>
589
579
rather than the initial value.
590
580
</div>
591
581
582
+ <div class='example'>
583
+ While a ''var()'' function can't get a [=CSS-wide keyword=]
584
+ from the [=custom property=] itself--
585
+ if you tried to specify that,
586
+ like ''--foo: initial;'' ,
587
+ it would just trigger [[css-cascade-4#defaulting-keywords|explicit defaulting]]
588
+ for the custom property--
589
+ it can have a [=CSS-wide keyword=] in its fallback:
590
+
591
+ <pre>
592
+ p { color: var(--does-not-exist, initial); }
593
+ </pre>
594
+
595
+ In the above code, if the ''--does-not-exist'' property didn't exist
596
+ or is [=invalid at computed-value time=] ,
597
+ the ''var()'' will instead substitute in the ''initial'' keyword,
598
+ making the property behave as if it was originally ''color: initial'' .
599
+ This will make it take on the document's initial 'color' value,
600
+ rather than defaulting to inheritance,
601
+ as it would if there were no fallback.
602
+ </div>
603
+
592
604
593
605
<h3 id='invalid-variables'>
594
606
Invalid Variables</h3>
0 commit comments