Skip to content

Commit 6492353

Browse files
committed
[css-values-5] Define inherit() for custom properties #2864
1 parent 5666cec commit 6492353

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

css-values-5/Overview.bs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,6 +1476,37 @@ Custom Property References: the ''var()'' notation
14761476
14771477
[[CSS-VARIABLES]]
14781478

1479+

1480+
Inherited Value References: the ''inherit()'' notation
1481+
1482+
Like the ''inherit'' keyword, the inherit() [=functional notation=]
1483+
resolves to the [=computed value=] of a property on the parent.
1484+
Rather than resolving to the value of the same property, however,
1485+
it resolves to the tokenized [=computed value=]
1486+
of the property specified as its first argument.
1487+
Its second argument, if present, is used as a fallback
1488+
in case the first argument resolves to the [=guaranteed-invalid value=].
1489+
1490+
''inherit()'' is an [=arbitrary substitution function=]
1491+
whose syntax is defined as:
1492+
1493+
1494+
<> = inherit( <>, <>? )
1495+
1496+
1497+
To [=resolve an arbitrary substitution function|resolve an inherit() function=],
1498+
return the [=inherited value=] of the [=custom property=] specified by the first argument,
1499+
and (if specified) the fallback specified by the second argument.
1500+
1501+
Note: Future levels of CSS may allow specifying standard CSS properties in ''inherit()'';
1502+
however because the tokenization of [=computed values=]
1503+
is not fully standardized for all CSS properties,
1504+
this feature is deferred from Level 5.
1505+
Note that the [=computed value=] differs from the [=used value=],
1506+
and is not always the resolved value returned by {{getComputedStyle()}};
1507+
thus even if ''inherit(width)'' were allowed,
1508+
it would frequently return the keyword ''width/auto'', not the used <>.
1509+
14791510
commit comments
Comments
 (0)