::picker()

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The ::picker() CSS pseudo-element targets the picker part of an element, for example the drop-down picker of a customizable select element.

Syntax

css
::picker() {
  /* ... */
}

Parameters

A string representing the element whose picker you want to target. The following values are available:

select

The drop-down picker of customizable select elements.

Description

The ::picker() pseudo-element targets the picker part of a form control, that is, the pop-up part that appears to allow you to make a selection when you press the control button. It is only available to target when the originating element has a picker and has base appearance set on it via the appearance property base-select value.

The ::picker(select) selector targets all descendants of customizable element and the picker have an implicit invoker/popover relationship assigned to them automatically, as specified by the Popover API. See Using the Popover API for more details of popover behavior, and see Animating the picker drop-down using popover states for a typical use case allowed by the implicit popover association.

Picker anchor positioning

A further side-effect of the implicit invoker/popover relationship mentioned above is that the element and its picker both need to have an appearance value of base-select set on them:

css
select,
::picker(select) {
  appearance: base-select;
}

You could then, for example, remove the picker's default black border:

css
::picker(select) {
  border: none;
}

Specifications

Specification
CSS Form Control Styling Level 1
# the-picker-pseudo-element

Browser compatibility

See also