diff --git a/selectors-5/Overview.bs b/selectors-5/Overview.bs index 7aa67de19f8..2f559d237e5 100644 --- a/selectors-5/Overview.bs +++ b/selectors-5/Overview.bs @@ -16,6 +16,7 @@ Abstract: Selectors Level 5 describes the selectors that already exist in [[!sel

@@ -154,6 +155,37 @@ Exposing custom state: the '':state()'' pseudo-class

see HTML's definition for more detail. Other host languages must define how this pseudo-class matches. +

+Heading Structures: the heading pseudo-classes '':heading'', and '':heading()''

+ + The (non-functional) :heading pseudo-class + matches an element which has a heading level, with respect to the + semantics defined by the document language (e.g. [[HTML5]]). + +
+ For example, the following sheet contains a rule applying to all heading + elements in the current page: + +
:heading { text-decoration: underline; }
+
+ + As a functional pseudo-class, + :heading(An+B) + notation represents elements that have a heading level among An+B. + +
+ 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: + +
:heading(-n+3) { font-weight: 900; }
+
:heading(n+6) { font-weight: 500; }
+
+ + Note: The heading level might be different from an element's + type selector. Thus, a selector ''h1:heading(3)'' matches any + ''h1'' tag which has an exposed heading level of 3. +

Combinators

@@ -202,6 +234,7 @@ Changes Since Level 4
  • The functional form of the '':local-link'' pseudo-class (deferred from an earlier draft of Selectors 4)
  • The '':state()'' pseudo-class
  • +
  • The '':heading'' and '':heading()'' pseudo-classes