Skip to content

Commit

Permalink
[css-pseudo-4] Define ::picker() (#10865)
Browse files Browse the repository at this point in the history
This was discussed here: #10440
  • Loading branch information
josepharhar authored Sep 17, 2024
1 parent 9af0cb8 commit 5344c61
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions css-pseudo-4/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1595,6 +1595,46 @@ details[open]::details-content {
}</pre>
</div>

<h3 id="picker-pseudo">
Styling form control pickers: the ''::picker()'' pseudo-element</h3>

The <dfn>::picker()</dfn> pseudo-element targets the popup picker of form
control elements which have popup pickers, such as the <{select}> element. It
is a [=part-like pseudo-element=].

<pre class=prod>
::picker() == ::picker( <<ident>>+ )
</pre>

Note: Once all of the controls that might support picker styling have it,
then we might add a (no-argument) ''::picker'' pseudo-element as well.

The ''::picker()'' pseudo-element only matches when the <a>originating
element</a> supports <a>base appearance</a> and has a popup picker. The
specified <<ident>> must also match the <dfn>unique picker name</dfn> of the
<a>originating element</a>. For example, the <a>unique picker name</a> for
the <{select}> element is "select".

Since it is a [=part-like pseudo-element=], There is no restriction on which
properties apply to the ''::picker()'' pseudo-element.

In order for the ''::picker()'' pseudo-element to be rendered, it and its
<a>originating element</a> must be rendered with <a>base appearance</a> by
applying ''appearance: base'' to both of them.

<pre class="example">
&lt;style>
select, select::picker(select) {
appearance: base;
}
select::picker(select) {
border: 5px solid red;
background-color: blue;
}
&lt;/style>
</pre>


<h2 id="interactions">
Overlapping Pseudo-element Interactions</h2>

Expand Down

0 comments on commit 5344c61

Please sign in to comment.