Skip to content

[selectors-5]: Update heading specs based on resolutions in #10296 #12404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 27, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[selectors-5]: allow :heading() to have An+B comma separated values
  • Loading branch information
keithamus committed Jun 27, 2025
commit 88fd8e2f2eb3b6b122281989f16e8c4bfc044852
12 changes: 10 additions & 2 deletions selectors-5/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,24 @@ Heading Structures: the heading pseudo-classes '':heading'', and '':heading()''<
</div>

As a functional pseudo-class,
<dfn id='heading-functional-pseudo' lt=':heading()'>:heading(<var>An+B</var>)</dfn>
<dfn id='heading-functional-pseudo' lt=':heading()'>:heading()</dfn>
notation represents elements that have a <a>heading level</a> among <var>An+B</var>.
The syntax is:

<pre class=prod>
::heading() = ::heading( <<An+B>># )
</pre>

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

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

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