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

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -962,25 +962,35 @@ Explicit Defaulting
962962
As specified in CSS Values and Units [[!css-values-3]],
963963
all CSS properties can accept these values.
964964

965-

965+

caniuse="css-initial-value">

966966
Resetting a Property: the ''initial'' keyword
967967

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

972-

975+

caniuse="mdn-api_csspropertyrule_inherits">

973976
Explicit Inheritance: the ''inherit'' keyword
974977

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

979-

985+

caniuse="css-unset-value">

980986
Erasing All Declarations: the ''unset'' keyword
981987

988+
The unset [=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 cascaded value of a property is
983-
the -value">unset 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 declared values occurring earlier in the cascade,

css-cascade-4/Overview.bs

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,36 +1237,49 @@ Explicit Defaulting
12371237
some contexts may restrict its use
12381238
while allowing the other [=CSS-wide keywords=].
12391239

1240-

1240+

caniuse="css-initial-value">

12411241
Resetting a Property: the ''initial'' keyword
12421242

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

1247-

1250+

caniuse="mdn-api_csspropertyrule_inherits">

12481251
Explicit Inheritance: the ''inherit'' keyword
12491252

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

1254-

1260+

caniuse="css-unset-value">

12551261
Erasing All Declarations: the ''unset'' keyword
12561262

1263+
The unset [=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 cascaded value of a property is
1258-
the -value">unset 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 declared values occurring earlier in the cascade,
12621272
correctly inheriting or not as appropriate for the property
12631273
(or all longhands of a shorthand).
12641274

1265-

1275+

for=all caniuse="css-revert-value">

12661276
Rolling Back Cascade Origins: the ''revert'' keyword
12671277

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

12721285

css-cascade-5/Overview.bs

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1822,36 +1822,49 @@ Explicit Defaulting
18221822
some contexts may restrict their use
18231823
while allowing the other [=CSS-wide keywords=].
18241824

1825-

1825+

caniuse="css-initial-value">

18261826
Resetting a Property: the ''initial'' keyword
18271827

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

1832-

1835+

caniuse="mdn-api_csspropertyrule_inherits">

18331836
Explicit Inheritance: the ''inherit'' keyword
18341837

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

1839-

1845+

caniuse="css-unset-value">

18401846
Erasing All Declarations: the ''unset'' keyword
18411847

1848+
The unset [=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 cascaded value of a property is
1843-
the -value">unset 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 declared values occurring earlier in the cascade,
18471857
correctly inheriting or not as appropriate for the property
18481858
(or all longhands of a shorthand).
18491859

1850-

1860+

for=all caniuse="css-revert-value">

18511861
Rolling Back Cascade Origins: the ''revert'' keyword
18521862

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

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

1885-

1898+

caniuse="mdn-css_types_global_keywords_revert-layer">

18861899
Rolling Back Cascade Layers: the ''revert-layer'' keyword
18871900

1888-
The revert-layer keyword
1901+
The revert-layer [=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 cascaded value of a property is
18921906
the ''revert-layer'' keyword,
18931907
the cascaded value is rolled back to the earlier [=layer=],

css-values-3/Overview.bs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ Component Value Types
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 <color>{1,4} | inherit | initial | unset
176177
(even though it is listed as <color>{1,4}).
177178

@@ -413,12 +414,8 @@ CSS-wide keywords: ''initial'', ''inherit'' and ''unset''
413414
As defined above,
414415
all properties accept the CSS-wide keywords,
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+
422419

423420
424421
css/css-values/initial-background-color.html

css-values-4/Overview.bs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ Component Value Types
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 <color>{1,4} | inherit | initial | unset
178179
(even though it is listed as <color>{1,4}).
179180

@@ -609,12 +610,8 @@ CSS-wide keywords: ''initial'', ''inherit'' and ''unset''
609610
As defined above,
610611
all properties accept the CSS-wide keywords,
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+
618615

619616
620617
css/css-multicol/multicol-inherit-002.xht

0 commit comments

Comments
 (0)