Skip to content

Commit e1fa32c

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. Built from https://develop.svn.wordpress.org/trunk@59854 git-svn-id: https://core.svn.wordpress.org/trunk@59196 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent cfaff36 commit e1fa32c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

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
/**

wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @global string $wp_version
1818
*/
19-
$wp_version = '6.8-alpha-59853';
19+
$wp_version = '6.8-alpha-59854';
2020

2121
/**
2222
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)