Make WordPress Core


Ignore:
Timestamp:
10/20/2026 12:27:21 PM (13 hours ago)
Author:
Mamaduka
Message:

Editor: Add pseudo-selector support for select elements.

Adds :hover, :focus, :focus-visible, and :active to the pseudo selectors that WP_Theme_JSON allows for the select element, so themes can style these states in theme.json.

Developed in ​https://github.com/WordPress/wordpress-develop/pull/14544.
Discussed in ​https://github.com/WordPress/gutenberg/pull/81644.

Props onemaggie, mikachan, mamaduka.
Fixes #66349.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-theme-json.php

    r64597 r64598  
    672672         * @since 7.2.0 Added ':required', ':user-valid', ':user-invalid', ':focus', ':focus-visible',
    673673         *              and '::placeholder' support for the text input element.
     674         * @since 7.2.0 Added ':hover', ':focus', ':focus-visible', and ':active' support for the select element.
    674675         * @var array
    675676         */
    … …  
    678679                'button'    => array( ':link', ':any-link', ':visited', ':hover', ':focus', ':focus-visible', ':active' ),
    679680                'textInput' => array( ':required', ':user-valid', ':user-invalid', ':focus', ':focus-visible', '::placeholder' ),
     681                'select'    => array( ':hover', ':focus', ':focus-visible', ':active' ),
    680682        );
    681683
Note: See TracChangeset for help on using the changeset viewer.