@@ -465,18 +465,20 @@ class WP_Theme_JSON_Gutenberg {
465
465
/**
466
466
* Defines which pseudo selectors are enabled for which elements.
467
467
*
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.
471
472
*
472
473
* See https://core.trac.wordpress.org/ticket/56928.
473
474
* Note: this will affect both top-level and block-level elements.
474
475
*
475
476
* @since 6.1.0
477
+ * @since 6.2.0 Added support for `:link` and `:any-link`.
476
478
*/
477
479
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 ' ),
480
482
);
481
483
482
484
/**
0 commit comments