mirror of
git://develop.git.wordpress.org/
synced 2025-03-24 05:49:49 +01:00
Themes: A11y: Merge omitted changes to support focus-visible
.
Merge PHP changes to ensure that `focus` doesn't match `focus-visible` in `WP_Theme_JSON`, overlooked in previous merge. Follow up to [59854]. Props huubl, joemcgill, joedolson. Fixes #62906. git-svn-id: https://develop.svn.wordpress.org/trunk@60055 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
bd6741447b
commit
dce8fe474d
@ -2906,7 +2906,11 @@ class WP_Theme_JSON {
|
||||
array_filter(
|
||||
$element_pseudo_allowed,
|
||||
static function ( $pseudo_selector ) use ( $selector ) {
|
||||
return str_contains( $selector, $pseudo_selector );
|
||||
/*
|
||||
* Check if the pseudo selector is in the current selector,
|
||||
* ensuring it is not followed by a dash (e.g., :focus should not match :focus-visible).
|
||||
*/
|
||||
return preg_match( '/' . preg_quote( $pseudo_selector, '/' ) . '(?!-)/', $selector ) === 1;
|
||||
}
|
||||
)
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user