Skip to content

Commit da6ea99

Browse files
committed
[css-cascade-5] Improve wording about layer order/precedence. #7041
1 parent b840144 commit da6ea99

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

css-cascade-5/Overview.bs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,13 +1036,14 @@ Cascade Sorting Order</h3>
10361036
any declaration not assigned to an explicit layer
10371037
is added to an implicit final layer.
10381038

1039-
Cascade layers (like declarations) are ordered by order of appearance.
1039+
Cascade layers (like declarations) are sorted by order of appearance,
1040+
see [[#layer-ordering]].
10401041
When comparing declarations that belong to different layers,
1041-
then for [=normal=] rules the declaration whose [=cascade layer=] is last wins,
1042-
and for [=important=] rules the declaration whose [=cascade layer=] is first wins.
1042+
then for [=normal=] rules the declaration whose [=cascade layer=] is latest in the layer order wins,
1043+
and for [=important=] rules the declaration whose [=cascade layer=] is earliest wins.
10431044

1044-
Note: This follows the same logic used for layering [=normal=] and [=important=] [=origins=],
1045-
so that the ''!important'' flag maintains the same “override” purpose in both settings.
1045+
Note: This follows the same logic used for precedence of [=normal=] and [=important=] [=origins=],
1046+
thus the ''!important'' flag maintains the same “override” purpose in both settings.
10461047

10471048
<dt id='cascade-specificity'>Specificity
10481049
<dd>
@@ -1224,7 +1225,7 @@ Cascade Layers</h3>
12241225

12251226
<div class="example">
12261227
For example, the following generates an explicit ''reset'' layer,
1227-
with lower cascade weight than any unlayered styles:
1228+
with lower cascade precedence than any unlayered styles:
12281229

12291230
<pre class='lang-css'>
12301231
audio {
@@ -1241,7 +1242,7 @@ Cascade Layers</h3>
12411242
</pre>
12421243

12431244
The unlayered declarations on the <{audio}> element take precedence
1244-
over the explicitly layered declarations on <code>audio[controls]</code> --
1245+
over the explicitly layered declarations on <code>audio[controls]</code>--
12451246
even though the unlayered styles have a lower specificity,
12461247
and come first in the order of appearance.
12471248
</div>
@@ -1493,8 +1494,9 @@ Layer Ordering</h4>
14931494

14941495
Cascade layers are sorted
14951496
by the order in which they first are declared,
1496-
with nested layers grouped within their parent layers
1497-
before any unlayered rules.
1497+
with nested layers grouped within their parent layer.
1498+
Unlayered rules are sorted later than
1499+
any layered rules within the same parent layer (if any).
14981500

14991501
<div class="example">
15001502
Given the following layer rules:

0 commit comments

Comments
 (0)