Skip to content

Commit

Permalink
Add new pseudo-elements for customizable select
Browse files Browse the repository at this point in the history
This PR adds the ::check and ::select-icon pseudo-elements so that
select elements can have a standardized and customizable dropdown icon
on the button and checkmarks next to options.

Fixes w3c#10908
  • Loading branch information
josepharhar committed Oct 1, 2024
1 parent 2fec812 commit b6bf511
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion css-pseudo-4/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1634,6 +1634,30 @@ Styling form control pickers: the ''::picker()'' pseudo-element</h3>
&lt;/style>
</pre>

<h3 id="select-arrow">
Select dropdown icon: the ''::select-arrow'' pseudo-element</h3>

The ''::select-arrow'' pseudo-element only matches when the <a>originating
element</a> is a <{select}> element. When its computed 'content' value is not
''content/none'', this pseudo-element generates a box as if it was an
immediate child of its <a>originating element</a>, with content as specified
by 'content'.

''::select-arrow'' is a [=part-like pseudo-element=], so there is no
restriction on which properties apply to the ''::select-arrow'' pseudo-element.

<h3 id="check">
Option checkmark icon: the ''::check'' pseudo-element</h3>

The '::check'' pseudo-element only matches when the <a>originating
element</a> is a <{option}> element. When its computed 'content' value is not
''content/none'', this pseudo-element generates a box as if it was an
immediate child of its <a>originating element</a>, with content as specified
by 'content'.

''::check'' is a [=part-like pseudo-element=], so there is no restriction on
which properties apply to the ''::check'' pseudo-element.


<h2 id="interactions">
Overlapping Pseudo-element Interactions</h2>
Expand Down Expand Up @@ -1986,4 +2010,4 @@ Acknowledgements</h2>
get-computed-style-crash.html
svg-text-selection-002.html
text-selection.html
</wpt>
</wpt>

0 comments on commit b6bf511

Please sign in to comment.