@@ -132,10 +132,10 @@ Selectors Overview</h2>
132
132
<td> [[#matches]]
133
133
<td> 4
134
134
<tr>
135
- <td><code> E:is (<var> s1</var> , <var> s2</var> )</code>
135
+ <td><code> E:something (<var> s1</var> , <var> s2</var> )</code>
136
136
<td> an E element that matches <a>compound selector</a> <var> s1</var>
137
137
and/or <a>compound selector</a> <var> s2</var> but contributes no specificity.
138
- <td> [[#is ]]
138
+ <td> [[#zero-matches ]]
139
139
<td> 4
140
140
<tr>
141
141
<td><code> E:has(<var> rs1</var> , <var> rs2</var> )</code>
@@ -1091,47 +1091,53 @@ The Matches-any Pseudo-class: '':matches()''</h3>
1091
1091
<pre> *|*:matches(*:hover, *:focus) </pre>
1092
1092
</div>
1093
1093
1094
- <h3 id="is ">
1095
- The Specificity-adjustment Pseudo-class: '':is ()''</h3>
1094
+ <h3 id="zero-matches ">
1095
+ The Specificity-adjustment Pseudo-class: '':something ()''</h3>
1096
1096
1097
- The Specificity-adjustment pseudo-class '':is()'' , is a functional pseudo-class
1098
- with the same syntax and functionality as '':matches()'' .
1099
- Unlike '':matches()'' , neither the pseudo-class, nor any of its arguments
1100
- contribute to the specificity of the selector.
1097
+ The Specificity-adjustment pseudo-class, <dfn id="something-pseudo">'':something()''</dfn> ,
1098
+ is a functional pseudo-class
1099
+ with the same syntax and functionality as '':matches()'' .
1100
+ Unlike '':matches()'' , neither the pseudo-class, nor any of its arguments
1101
+ contribute to the specificity of the selector--
1102
+ its specificity is always zero.
1101
1103
1102
- This is useful for introducing filters in a selector while keeping it easy to override.
1104
+ This is useful for introducing filters in a selector
1105
+ while keeping the associated style declarations easy to override.
1103
1106
1104
- <div class="example">
1105
- Below is a common example where the specificity heuristic fails
1106
- to match author expectations:
1107
+ ISSUE: This pseudo-class needs a name. See <a href="https://github.com/w3c/csswg-drafts/issues/1170">discussion</a> .
1107
1108
1108
- <pre>
1109
- a:not(:hover) {
1110
- text-decoration: none;
1111
- }
1109
+ <div class="example">
1110
+ Below is a common example where the specificity heuristic fails
1111
+ to match author expectations:
1112
1112
1113
- nav a {
1114
- /* Has no effect */
1115
- text-decoration: underline;
1116
- }
1117
- </pre>
1113
+ <pre>
1114
+ a:not(:hover) {
1115
+ text-decoration: none;
1116
+ }
1117
+
1118
+ nav a {
1119
+ /* Has no effect */
1120
+ text-decoration: underline;
1121
+ }
1122
+ </pre>
1118
1123
1119
- However, by using '':is ()'' the author can explicitly declare their intent:
1124
+ However, by using '':something ()'' the author can explicitly declare their intent:
1120
1125
1121
- <pre>
1122
- a:is (:not(:hover)) {
1123
- text-decoration: none;
1124
- }
1125
-
1126
- nav a {
1127
- /* Works now! */
1128
- text-decoration: underline;
1129
- }
1130
- </pre>
1131
- </div>
1126
+ <pre>
1127
+ a:something (:not(:hover)) {
1128
+ text-decoration: none;
1129
+ }
1130
+
1131
+ nav a {
1132
+ /* Works now! */
1133
+ text-decoration: underline;
1134
+ }
1135
+ </pre>
1136
+ </div>
1132
1137
1133
- Note: Future versions of this specification may introduce a second argument to explicitly set
1134
- the specificity of each instance of this pseudo-class, which will default to zero.
1138
+ Note: Future versions of this specification may introduce a second argument
1139
+ to explicitly set the specificity of each instance of this pseudo-class,
1140
+ which will default to zero.
1135
1141
1136
1142
<h3 id="negation">
1137
1143
The Negation Pseudo-class: '':not()''</h3>
@@ -3135,7 +3141,7 @@ Calculating a selector's specificity</h2>
3135
3141
the specificity of its selector list argument.
3136
3142
(The full selector's specificity is equivalent to expanding out all the combinations in full, without '':matches()'' .)
3137
3143
<li>
3138
- The specificity of an '':is ()'' pseudo-class is replaced by 0.
3144
+ The specificity of an '':something ()'' pseudo-class is replaced by 0.
3139
3145
<li>
3140
3146
Similarly, the specificity of an '':nth-child()'' , '':nth-last-child()'' , '':nth-of-type()'' , or '':nth-last-of-type()'' selector
3141
3147
is the specificity of the pseudo class itself (counting as one pseudo-class selector)
@@ -3153,7 +3159,7 @@ Calculating a selector's specificity</h2>
3153
3159
a specificity of (0,0,1)--like a tag selector--when matched against <code> <em></code> ,
3154
3160
and a specificity of (1,0,0)--like an ID selector--when matched against <code> <em id=foo></code> .
3155
3161
<li>
3156
- ''div:is (em, #foo#bar#baz)'' has
3162
+ ''div:something (em, #foo#bar#baz)'' has
3157
3163
a specificity of (0,0,1): only the ''div'' contributes to selector specificity.
3158
3164
<li>
3159
3165
'':nth-child(even of li, .item)'' has
@@ -3644,7 +3650,7 @@ Changes</h2>
3644
3650
3645
3651
<ul>
3646
3652
<li> Added '':target-within'' </li>
3647
- <li> Added '':is ()'' pseudo-class.</li>
3653
+ <li> Added a zero-specificity '':matches ()'' -type pseudo-class, with name TBD .</li>
3648
3654
<li> Split out <a>relative selectors</a> from <a>scoped selectors</a> ,
3649
3655
as these are different concepts that can be independently invoked.
3650
3656
<li> Changed rules for absolutizing a relative selector.
0 commit comments