Skip to content

Commit 88fd8e2

Browse files
committed
[selectors-5]: allow :heading() to have An+B comma separated values
1 parent 4c4b37a commit 88fd8e2

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

‎selectors-5/Overview.bs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,16 +170,24 @@ Heading Structures: the heading pseudo-classes '':heading'', and '':heading()''<
170170
</div>
171171

172172
As a functional pseudo-class,
173-
<dfn id='heading-functional-pseudo' lt=':heading()'>:heading(<var>An+B</var>)</dfn>
173+
<dfn id='heading-functional-pseudo' lt=':heading()'>:heading()</dfn>
174174
notation represents elements that have a <a>heading level</a> among <var>An+B</var>.
175+
The syntax is:
176+
177+
<pre class=prod>
178+
::heading() = ::heading( <<An+B>># )
179+
</pre>
175180

176181
<div class="example">
177182
The following example styles headings with levels between 1 and 3 with a
178183
font-weight of 900, while headings with levels 6 onward with font-weight of
179-
500:
184+
500, additionally heading levels 1 and 2 will be underlined, while 3 and
185+
beyond will have no text-decoration:
180186

181187
<pre>:heading(-n+3) { font-weight: 900; }</pre>
182188
<pre>:heading(n+6) { font-weight: 500; }</pre>
189+
<pre>:heading(1, 2) { text-decoration: underline; }</pre>
190+
<pre>:heading(n+3) { text-decoration: none; }</pre>
183191
</div>
184192

185193
Note: The <a>heading level</a> might be different from an element's

0 commit comments

Comments
 (0)