Skip to content

Commit

Permalink
Add support for :link and :any-link in theme.json (#48634)
Browse files Browse the repository at this point in the history
Co-authored-by: Mukesh Panchal <mukeshpanchal27@users.noreply.github.com>
  • Loading branch information
oandregal and mukeshpanchal27 authored Mar 2, 2023
1 parent 62ad881 commit a889ec8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -465,18 +465,20 @@ class WP_Theme_JSON_Gutenberg {
/**
* Defines which pseudo selectors are enabled for which elements.
*
* The order of the selectors should be: visited, hover, focus, active.
* This is to ensure that 'visited' has the lowest specificity
* and the other selectors can always overwrite it.
* The order of the selectors should be: link, any-link, visited, hover, focus, 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.
*
* See https://core.trac.wordpress.org/ticket/56928.
* Note: this will affect both top-level and block-level elements.
*
* @since 6.1.0
* @since 6.2.0 Added support for `:link` and `:any-link`.
*/
const VALID_ELEMENT_PSEUDO_SELECTORS = array(
'link' => array( ':visited', ':hover', ':focus', ':active' ),
'button' => array( ':visited', ':hover', ':focus', ':active' ),
'link' => array( ':link', ':any-link', ':visited', ':hover', ':focus', ':active' ),
'button' => array( ':link', ':any-link', ':visited', ':hover', ':focus', ':active' ),
);

/**
Expand Down

1 comment on commit a889ec8

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in a889ec8.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4315821033
📝 Reported issues:

Please sign in to comment.