Skip to content

Commit b8f28f9

Browse files
committed
Themes: Support :focus-visible in theme.json.
Add the `:focus-visible` pseudo selector as a valid element in the `theme.json` schema. See also WordPress/gutenberg#68521. Props huubl, audrasjb, poena, sabernhardt, afercia, annebovelett. Fixes #62906. git-svn-id: https://develop.svn.wordpress.org/trunk@59854 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 1d77cfa commit b8f28f9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/wp-includes/class-wp-theme-json.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ class WP_Theme_JSON {
578578
/**
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
584584
* the unvisited styles.
@@ -588,11 +588,12 @@ class WP_Theme_JSON {
588588
*
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

598599
/**

0 commit comments

Comments
 (0)