Skip to content

Commit a889ec8

Browse files
Add support for :link and :any-link in theme.json (#48634)
Co-authored-by: Mukesh Panchal <[email protected]>
1 parent 62ad881 commit a889ec8

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/class-wp-theme-json-gutenberg.php

+7-5
Original file line numberDiff line numberDiff line change
@@ -465,18 +465,20 @@ class WP_Theme_JSON_Gutenberg {
465465
/**
466466
* Defines which pseudo selectors are enabled for which elements.
467467
*
468-
* The order of the selectors should be: visited, hover, focus, active.
469-
* This is to ensure that 'visited' has the lowest specificity
470-
* and the other selectors can always overwrite it.
468+
* The order of the selectors should be: link, any-link, visited, hover, focus, active.
469+
* This is to ensure the user action (hover, focus and active) styles have a higher
470+
* specificity than the visited styles, which in turn have a higher specificity than
471+
* the unvisited styles.
471472
*
472473
* See https://core.trac.wordpress.org/ticket/56928.
473474
* Note: this will affect both top-level and block-level elements.
474475
*
475476
* @since 6.1.0
477+
* @since 6.2.0 Added support for `:link` and `:any-link`.
476478
*/
477479
const VALID_ELEMENT_PSEUDO_SELECTORS = array(
478-
'link' => array( ':visited', ':hover', ':focus', ':active' ),
479-
'button' => array( ':visited', ':hover', ':focus', ':active' ),
480+
'link' => array( ':link', ':any-link', ':visited', ':hover', ':focus', ':active' ),
481+
'button' => array( ':link', ':any-link', ':visited', ':hover', ':focus', ':active' ),
480482
);
481483

482484
/**

0 commit comments

Comments
 (0)