Skip to content

Commit a9fddaf

Browse files
committed
[selectors-4] Add :is() example in specificity section, and add it in Overview section too
1 parent 5948b1c commit a9fddaf

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

selectors-4/Overview.bs

+9
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,12 @@ Selectors Overview</h2>
131131
and/or <a>compound selector</a> <var>s2</var>
132132
<td>[[#matches]]
133133
<td>4
134+
<tr>
135+
<td><code>E:is(<var>s1</var>, <var>s2</var>)</code>
136+
<td>an E element that matches <a>compound selector</a> <var>s1</var>
137+
and/or <a>compound selector</a> <var>s2</var> but contributes no specificity.
138+
<td>[[#is]]
139+
<td>4
134140
<tr>
135141
<td><code>E:has(<var>rs1</var>, <var>rs2</var>)</code>
136142
<td>an E element,
@@ -3127,6 +3133,9 @@ Calculating a selector's specificity</h2>
31273133
'':matches(em, #foo)'' has
31283134
a specificity of (0,0,1)--like a tag selector--when matched against <code>&lt;em></code>,
31293135
and a specificity of (1,0,0)--like an ID selector--when matched against <code>&lt;em id=foo></code>.
3136+
<li>
3137+
''div:is(em, #foo#bar#baz)'' has
3138+
a specificity of (0,0,1): only the ''div'' contributes to selector specificity.
31303139
<li>
31313140
'':nth-child(even of li, .item)'' has
31323141
a specificity of (0,1,1)--like a tag selector plus a pseudo-class--when matched against <code>&lt;li></code>,

0 commit comments

Comments
 (0)