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
[css-navigation-1] Change :trigger-link to :nav-source and include submit/form (#14122)
* [css-navigation-1] Change `:trigger-link` to `:nav-source` and include form/submit as well
Resolution:
#11801 (comment)Closes#11801
* Update css-navigation-1/Overview.bs
Co-authored-by: Bramus <bramus@bram.us>
---------
Co-authored-by: Bramus <bramus@bram.us>
that matches link elements that trigger the current navigation.
604
-
605
-
The '':trigger-link'' pseudo-class matches any element where both:
606
-
* the element matches '':any-link''
607
-
* the [=current navigation state=] is not null, and element is its [=navigation state/source element=].
601
+
This specification defines a <dfn id="nav-source-pseudo" selector>'':nav-source''</dfn> pseudo-class,
602
+
matching the element that triggered the current navigation. It is a CSS reflection of the {{NavigateEvent/sourceElement}} property in the Navigation API.
603
+
The trigger element can be an [^a^], [^area^], [^form^], a [^input/type/submit^] input, or a [^button^].
608
604
609
-
Issue: should this apply to forms or submit buttons?
605
+
The '':nav-source'' pseudo-class matches any element <var>el</var> where
606
+
the [=current navigation state=] is not null, and <var>el</var> is its [=navigation state/source element=].
610
607
611
608
<div class="example">
612
609
613
-
A simple example of a '':trigger-link'' selector is this one,
610
+
A simple example of a '':nav-source'' selector is this one,
614
611
which sets the ''view-transition-name'' for an image thumbnail that is a child of the link that triggers the current navigation.
615
612
616
-
617
-
<pre highlight=css>
618
-
:trigger-link .thumb {
613
+
<pre highlight=css>``
614
+
a:nav-source .thumb {
619
615
view-transition-name: active-image;
620
616
}
621
617
</pre>
622
618
619
+
The '':nav-source'' pseudo-class can also be used for forms and submit buttons:
620
+
621
+
<pre highlight=css>``
622
+
form:nav-source .submit,
623
+
.submit:nav-source {
624
+
outline: 3px solid green;
625
+
}
626
+
</pre>
627
+
623
628
</div>
624
629
625
630
<h2 id="conditional-navigation-queries">Conditional rules for navigation queries</h2>
0 commit comments