You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: css-overflow-5/Overview.bs
+49-8Lines changed: 49 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -366,21 +366,62 @@ The 'scroll-marker-group' property</h4>
366
366
or via the tab key when currently active or when no other ''::scroll-marker'' is active and this is the first marker in the group,
367
367
ensuring the group has a <a href="https://open-ui.org/components/focusgroup.explainer/#guaranteed-tab-stop">guaranteed tab stop</a>.
368
368
369
-
<h4 id="active-scroll-marker">
370
-
Selecting The Active Scroll Marker: the '':target-current'' pseudo-class</h4>
369
+
<h4 id="active-before-after-scroll-markers">
370
+
Selecting Scroll Markers: '':target-current'', '':target-before'' and '':target-after'' pseudo-classes</h4>
371
371
372
372
Exactly one [=scroll marker=] within each [=scroll marker group=] is determined to be active at a time.
373
373
Such "active" [=scroll markers=] match the <dfn selector>:target-current</dfn> pseudo-class.
374
374
375
-
<div class='example'>
376
-
The following snippet shows how the link to the currently scrolled section can be highlighted:
375
+
In addition to the <a>:target-current</a> pseudo-class, this specification introduces the <dfn selector>:target-before</dfn> and <dfn selector>:target-after</dfn> pseudo-classes for use with [=scroll marker=] elements.
376
+
377
+
These pseudo-classes match [=scroll marker=]s that are, respectively, before or after the [=active marker=] (the one matching <a>:target-current</a>) within the same [=scroll marker group=], as determined by [=flat tree order=]:
378
+
379
+
- <b>:target-before</b> matches all [=scroll marker=]s that precede the [=active marker=] in the flat tree order within the group.
380
+
- <b>:target-after</b> matches all [=scroll marker=]s that follow the [=active marker=] in the flat tree order within the group.
377
381
378
-
<pre highlight=css>
382
+
<div class='example'>
383
+
The following snippet demonstrates how to style the active scroll marker and scroll markers before and after the currently active one in a table of contents:
384
+
385
+
<pre><code highlight="html">
386
+
<!DOCTYPE HTML>
387
+
<title>:target-before and :target-after example</title>
@@ -456,7 +497,7 @@ Selecting The Active Scroll Marker: the '':target-current'' pseudo-class</h4>
456
497
Focus |active marker|
457
498
1. Set the <a href="https://open-ui.org/components/focusgroup.explainer/#last-focused-memory">last-focused element</a> of the |group| to |active marker|.
458
499
1. Set the active state of all other [=scroll marker=] elements in |group| to false.
0 commit comments