Make WordPress Core

Changeset 59854


Ignore:
Timestamp:
02/21/2025 04:46:34 PM (2 months ago)
Author:
joedolson
Message:

Themes: Support :focus-visible in theme.json.

Add the :focus-visible pseudo selector as a valid element in the theme.json schema. See also https://github.com/WordPress/gutenberg/pull/68521.

Props huubl, audrasjb, poena, sabernhardt, afercia, annebovelett.
Fixes #62906.

File:
1 edited

Legend:

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

    r59814 r59854  
    579579     * Defines which pseudo selectors are enabled for which elements.
    580580     *
    581      * The order of the selectors should be: link, any-link, visited, hover, focus, active.
     581     * The order of the selectors should be: link, any-link, visited, hover, focus, focus-visible, active.
    582582     * This is to ensure the user action (hover, focus and active) styles have a higher
    583583     * specificity than the visited styles, which in turn have a higher specificity than
     
    589589     * @since 6.1.0
    590590     * @since 6.2.0 Added support for ':link' and ':any-link'.
     591     * @since 6.8.0 Added support for ':focus-visible'.
    591592     * @var array
    592593     */
    593594    const VALID_ELEMENT_PSEUDO_SELECTORS = array(
    594         'link'   => array( ':link', ':any-link', ':visited', ':hover', ':focus', ':active' ),
    595         'button' => array( ':link', ':any-link', ':visited', ':hover', ':focus', ':active' ),
     595        'link'   => array( ':link', ':any-link', ':visited', ':hover', ':focus', ':focus-visible', ':active' ),
     596        'button' => array( ':link', ':any-link', ':visited', ':hover', ':focus', ':focus-visible', ':active' ),
    596597    );
    597598
Note: See TracChangeset for help on using the changeset viewer.