mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Themes: Support additional link related pseudo classes in theme.json.
This changeset adds support for `:link` and `:any-link` in `theme.json`, using the `VALID_ELEMENT_PSEUDO_SELECTORS` array. `:link` can be used to style unvisited links and `:any-link` can be used to style any link containing an `href` attribute. Props peterwilsoncc, whaze, audrasjb, costdev, mukesh27. Fixes #57053. git-svn-id: https://develop.svn.wordpress.org/trunk@55121 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
0ab4ae8b4c
commit
0ed98f98f2
@ -408,18 +408,20 @@ class WP_Theme_JSON {
|
||||
/**
|
||||
* 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' ),
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user