Skip to content

Commit 9b95cab

Browse files
committed
[css-values][css-cascade] Refactor CSS-wide keyword definitions #7439
* Move descriptive text from Values to Cascade * Define Cascade as source of keyword definitions
1 parent a840824 commit 9b95cab

File tree

5 files changed

+67
-36
lines changed

5 files changed

+67
-36
lines changed

css-cascade-3/Overview.bs

+16-6
Original file line numberDiff line numberDiff line change
@@ -962,25 +962,35 @@ Explicit Defaulting</h3>
962962
As specified in <a href="https://www.w3.org/TR/css-values/#common-keywords">CSS Values and Units</a> [[!css-values-3]],
963963
all CSS properties can accept these values.
964964

965-
<h4 id="initial">
965+
<h4 id="initial" caniuse="css-initial-value">
966966
Resetting a Property: the ''initial'' keyword</h4>
967967

968+
The <dfn value for=all>initial</dfn> [=CSS-wide keyword=]
969+
represents the value defined as the property's [=initial value=].
970+
968971
If the <a>cascaded value</a> of a property is
969-
the <dfn value for=all caniuse="css-initial-value">initial</dfn> keyword,
972+
the ''initial'' keyword,
970973
the property's <a>specified value</a> is its <a>initial value</a>.
971974

972-
<h4 id="inherit">
975+
<h4 id="inherit" caniuse="mdn-api_csspropertyrule_inherits">
973976
Explicit Inheritance: the ''inherit'' keyword</h4>
974977

978+
The <dfn value for=all>inherit</dfn> [=CSS-wide keyword=]
979+
represents the property’s [=computed value=] on the parent element.
980+
975981
If the <a>cascaded value</a> of a property is
976-
the <dfn value for=all>inherit</dfn> keyword,
982+
the ''inherit'' keyword,
977983
the property's <a lt="specified value">specified</a> and <a>computed values</a> are the <a>inherited value</a>.
978984

979-
<h4 id="inherit-initial">
985+
<h4 id="inherit-initial" caniuse="css-unset-value">
980986
Erasing All Declarations: the ''unset'' keyword</h4>
981987

988+
The <dfn value for=all>unset</dfn> [=CSS-wide keyword=]
989+
acts as either ''inherit'' or ''initial'',
990+
depending on whether the property is [=inherited property|inherited=] or not.
991+
982992
If the <a>cascaded value</a> of a property is
983-
the <dfn value for=all caniuse="css-unset-value">unset</dfn> keyword,
993+
the ''unset'' keyword,
984994
then if it is an inherited property, this is treated as ''inherit'',
985995
and if it is not, this is treated as ''initial''.
986996
This keyword effectively erases all <a>declared values</a> occurring earlier in the <a>cascade</a>,

css-cascade-4/Overview.bs

+21-8
Original file line numberDiff line numberDiff line change
@@ -1237,36 +1237,49 @@ Explicit Defaulting</h3>
12371237
some contexts may restrict its use
12381238
while allowing the other [=CSS-wide keywords=].
12391239

1240-
<h4 id="initial">
1240+
<h4 id="initial" caniuse="css-initial-value">
12411241
Resetting a Property: the ''initial'' keyword</h4>
12421242

1243+
The <dfn value for=all>initial</dfn> [=CSS-wide keyword=]
1244+
represents the value defined as the property's [=initial value=].
1245+
12431246
If the <a>cascaded value</a> of a property is
1244-
the <dfn value for=all caniuse="css-initial-value">initial</dfn> keyword,
1247+
the ''initial'' keyword,
12451248
the property's <a>specified value</a> is its <a>initial value</a>.
12461249

1247-
<h4 id="inherit">
1250+
<h4 id="inherit" caniuse="mdn-api_csspropertyrule_inherits">
12481251
Explicit Inheritance: the ''inherit'' keyword</h4>
12491252

1253+
The <dfn value for=all>inherit</dfn> [=CSS-wide keyword=]
1254+
represents the property’s [=computed value=] on the parent element.
1255+
12501256
If the <a>cascaded value</a> of a property is
1251-
the <dfn value for=all>inherit</dfn> keyword,
1257+
the ''inherit'' keyword,
12521258
the property's <a lt="specified value">specified</a> and <a>computed values</a> are the <a>inherited value</a>.
12531259

1254-
<h4 id="inherit-initial">
1260+
<h4 id="inherit-initial" caniuse="css-unset-value">
12551261
Erasing All Declarations: the ''unset'' keyword</h4>
12561262

1263+
The <dfn value for=all>unset</dfn> [=CSS-wide keyword=]
1264+
acts as either ''inherit'' or ''initial'',
1265+
depending on whether the property is [=inherited property|inherited=] or not.
1266+
12571267
If the <a>cascaded value</a> of a property is
1258-
the <dfn value for=all caniuse="css-unset-value">unset</dfn> keyword,
1268+
the ''unset'' keyword,
12591269
then if it is an inherited property, this is treated as ''inherit'',
12601270
and if it is not, this is treated as ''initial''.
12611271
This keyword effectively erases all <a>declared values</a> occurring earlier in the <a>cascade</a>,
12621272
correctly inheriting or not as appropriate for the property
12631273
(or all longhands of a <a>shorthand</a>).
12641274

1265-
<h4 id="default">
1275+
<h4 id="default" for=all caniuse="css-revert-value">
12661276
Rolling Back Cascade Origins: the ''revert'' keyword</h4>
12671277

1278+
The <dfn value>revert</dfn> [=CSS-wide keyword=]
1279+
rolls back the cascade to the [=cascaded value=] of the earlier [=origin=].
1280+
12681281
If the <a>cascaded value</a> of a property is
1269-
the <dfn value for=all caniuse="css-revert-value">revert</dfn> keyword,
1282+
the ''revert'' keyword,
12701283
the behavior depends on the [=cascade origin=] to which the [=declaration=] belongs:
12711284

12721285
<dl>

css-cascade-5/Overview.bs

+24-10
Original file line numberDiff line numberDiff line change
@@ -1822,36 +1822,49 @@ Explicit Defaulting</h3>
18221822
some contexts may restrict their use
18231823
while allowing the other [=CSS-wide keywords=].
18241824

1825-
<h4 id="initial">
1825+
<h4 id="initial" caniuse="css-initial-value">
18261826
Resetting a Property: the ''initial'' keyword</h4>
18271827

1828+
The <dfn value for=all>initial</dfn> [=CSS-wide keyword=]
1829+
represents the value defined as the property's [=initial value=].
1830+
18281831
If the <a>cascaded value</a> of a property is
1829-
the <dfn value for=all caniuse="css-initial-value">initial</dfn> keyword,
1832+
the ''initial'' keyword,
18301833
the property's <a>specified value</a> is its <a>initial value</a>.
18311834

1832-
<h4 id="inherit">
1835+
<h4 id="inherit" caniuse="mdn-api_csspropertyrule_inherits">
18331836
Explicit Inheritance: the ''inherit'' keyword</h4>
18341837

1838+
The <dfn value for=all>inherit</dfn> [=CSS-wide keyword=]
1839+
represents the property’s [=computed value=] on the parent element.
1840+
18351841
If the <a>cascaded value</a> of a property is
1836-
the <dfn value for=all>inherit</dfn> keyword,
1842+
the ''inherit'' keyword,
18371843
the property's <a lt="specified value">specified</a> and <a>computed values</a> are the <a>inherited value</a>.
18381844

1839-
<h4 id="inherit-initial">
1845+
<h4 id="inherit-initial" caniuse="css-unset-value">
18401846
Erasing All Declarations: the ''unset'' keyword</h4>
18411847

1848+
The <dfn value for=all>unset</dfn> [=CSS-wide keyword=]
1849+
acts as either ''inherit'' or ''initial'',
1850+
depending on whether the property is [=inherited property|inherited=] or not.
1851+
18421852
If the <a>cascaded value</a> of a property is
1843-
the <dfn value for=all caniuse="css-unset-value">unset</dfn> keyword,
1853+
the ''unset'' keyword,
18441854
then if it is an inherited property, this is treated as ''inherit'',
18451855
and if it is not, this is treated as ''initial''.
18461856
This keyword effectively erases all <a>declared values</a> occurring earlier in the <a>cascade</a>,
18471857
correctly inheriting or not as appropriate for the property
18481858
(or all longhands of a <a>shorthand</a>).
18491859

1850-
<h4 id="default">
1860+
<h4 id="default" for=all caniuse="css-revert-value">
18511861
Rolling Back Cascade Origins: the ''revert'' keyword</h4>
18521862

1863+
The <dfn value>revert</dfn> [=CSS-wide keyword=]
1864+
rolls back the cascade to the [=cascaded value=] of the earlier [=origin=].
1865+
18531866
If the <a>cascaded value</a> of a property is
1854-
the <dfn value for=all caniuse="css-revert-value">revert</dfn> keyword,
1867+
the ''revert'' keyword,
18551868
the behavior depends on the [=cascade origin=] to which the [=declaration=] belongs:
18561869

18571870
<dl>
@@ -1882,12 +1895,13 @@ Rolling Back Cascade Origins: the ''revert'' keyword</h4>
18821895
reverting one of the paired properties in a [=logical property group=]
18831896
also reverts the other one; etc.
18841897

1885-
<h4 id="revert-layer">
1898+
<h4 id="revert-layer" caniuse="mdn-css_types_global_keywords_revert-layer">
18861899
Rolling Back Cascade Layers: the ''revert-layer'' keyword</h4>
18871900

1888-
The <dfn value for=all>revert-layer</dfn> keyword
1901+
The <dfn value for=all>revert-layer</dfn> [=CSS-wide keyword=]
18891902
rolls back the cascade similar to ''revert'',
18901903
except it works by [=cascade layer=] rather than by [=cascade origin=].
1904+
18911905
If the <a>cascaded value</a> of a property is
18921906
the ''revert-layer'' keyword,
18931907
the <a>cascaded value</a> is rolled back to the earlier [=layer=],

css-values-3/Overview.bs

+3-6
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ Component Value Types</h3>
172172
as the sole component of their property value.
173173
For readability these are not listed explicitly in the property value syntax definitions.
174174
For example, the full value definition of 'border-color'
175+
under [[CSS-CASCADE-3|CSS Cascading and Inheritance Level 3]]
175176
is <code>&lt;color>{1,4} | inherit | initial | unset</code>
176177
(even though it is listed as <code>&lt;color>{1,4}</code>).
177178

@@ -413,12 +414,8 @@ CSS-wide keywords: ''initial'', ''inherit'' and ''unset''</h4>
413414
As defined <a href="#component-types">above</a>,
414415
all properties accept the <dfn export>CSS-wide keywords</dfn>,
415416
which represent value computations common to all CSS properties.
416-
417-
The ''initial'' keyword represents the value specified as the property's initial value.
418-
The ''inherit'' keyword represents the computed value of the property on the element's parent.
419-
The ''unset'' keyword acts as either ''inherit'' or ''initial'',
420-
depending on whether the property is inherited or not.
421-
All of these keywords are normatively defined in the Cascade module. [[!CSS3CASCADE]]
417+
These keywords are normatively defined in
418+
the <a href="https://www.w3.org/TR/css-cascade/#defaulting-keywords">CSS Cascading and Inheritance Module</a>.
422419

423420
<wpt>
424421
css/css-values/initial-background-color.html

css-values-4/Overview.bs

+3-6
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ Component Value Types</h3>
174174
as the sole component of their property value.
175175
For readability these are not listed explicitly in the property value syntax definitions.
176176
For example, the full value definition of 'border-color'
177+
under [[CSS-CASCADE-3|CSS Cascading and Inheritance Level 3]]
177178
is <code>&lt;color>{1,4} | inherit | initial | unset</code>
178179
(even though it is listed as <code>&lt;color>{1,4}</code>).
179180

@@ -609,12 +610,8 @@ CSS-wide keywords: ''initial'', ''inherit'' and ''unset''</h4>
609610
As defined <a href="#component-types">above</a>,
610611
all properties accept the <dfn export>CSS-wide keywords</dfn>,
611612
which represent value computations common to all CSS properties.
612-
613-
The ''initial'' keyword represents the value specified as the property's initial value.
614-
The ''inherit'' keyword represents the computed value of the property on the element's parent.
615-
The ''unset'' keyword acts as either ''inherit'' or ''initial'',
616-
depending on whether the property is inherited or not.
617-
All of these keywords are normatively defined in the Cascade module. [[!CSS3CASCADE]]
613+
These keywords are normatively defined in
614+
the <a href="https://www.w3.org/TR/css-cascade/#defaulting-keywords">CSS Cascading and Inheritance Module</a>.
618615

619616
<wpt>
620617
css/css-multicol/multicol-inherit-002.xht

0 commit comments

Comments
 (0)