From 690d90478656377b7f1ea027e2ddaf3b025751e5 Mon Sep 17 00:00:00 2001 From: joedolson Date: Fri, 21 Feb 2025 16:48:22 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@59854 git-svn-id: http://core.svn.wordpress.org/trunk@59196 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-theme-json.php | 7 ++++--- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/wp-includes/class-wp-theme-json.php b/wp-includes/class-wp-theme-json.php index dafbfb405c..cf8b7961e5 100644 --- a/wp-includes/class-wp-theme-json.php +++ b/wp-includes/class-wp-theme-json.php @@ -578,7 +578,7 @@ class WP_Theme_JSON { /** * Defines which pseudo selectors are enabled for which elements. * - * The order of the selectors should be: link, any-link, visited, hover, focus, active. + * The order of the selectors should be: link, any-link, visited, hover, focus, focus-visible, active. * This is to ensure the user action (hover, focus and active) styles have a higher * specificity than the visited styles, which in turn have a higher specificity than * the unvisited styles. @@ -588,11 +588,12 @@ class WP_Theme_JSON { * * @since 6.1.0 * @since 6.2.0 Added support for ':link' and ':any-link'. + * @since 6.8.0 Added support for ':focus-visible'. * @var array */ const VALID_ELEMENT_PSEUDO_SELECTORS = array( - 'link' => array( ':link', ':any-link', ':visited', ':hover', ':focus', ':active' ), - 'button' => array( ':link', ':any-link', ':visited', ':hover', ':focus', ':active' ), + 'link' => array( ':link', ':any-link', ':visited', ':hover', ':focus', ':focus-visible', ':active' ), + 'button' => array( ':link', ':any-link', ':visited', ':hover', ':focus', ':focus-visible', ':active' ), ); /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 0d3ef1b9d1..1b10905ced 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.8-alpha-59853'; +$wp_version = '6.8-alpha-59854'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.