#57053 closed enhancement (fixed)
Themes: Support additional link related pseudo classes in `theme.json`.
Reported by: | peterwilsoncc | Owned by: | audrasjb |
---|---|---|---|
Milestone: | 6.2 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Themes | Keywords: | has-patch commit add-to-field-guide |
Focuses: | css | Cc: |
Description
class-wp-theme-json.php
is currently missing the :link
and :any-link
pseudo classes as valid selectors:
<?php const VALID_ELEMENT_PSEUDO_SELECTORS = array( 'link' => array( ':visited', ':hover', ':focus', ':active' ), 'button' => array( ':visited', ':hover', ':focus', ':active' ), );
:link
can be used to style unvisited links and has wide browser support; :any-link
can be used to style links containing an `href` attribute but is unsupported in Safari browsers.
Similar to the issue faced in #56928, order is important. These would need to be added at the start of the lists.
Change History (11)
This ticket was mentioned in PR #3631 on WordPress/wordpress-develop by @whaze.
2 years ago
#1
- Keywords has-patch added; needs-patch removed
@audrasjb commented on PR #3631:
2 years ago
#2
Thanks for the patch!
https://github.com/WordPress/wordpress-develop/pull/3631/commits/56b013e245995e733ab8dde551c0c36e28d1d4a1 adds related docblock changes.
#3
@
2 years ago
- Milestone changed from Awaiting Review to 6.2
- Owner set to audrasjb
- Status changed from new to accepted
I think we're ready to go now :)
Moving for 6.2 consideration.
This ticket was mentioned in Slack in #core by mukeshpanchal27. View the logs.
21 months ago
#5
@
21 months ago
- Keywords commit added
As discuss in today's bug scrub PR looks good to go!
commit
keyword added.
Prop to @costdev.
@peterwilsoncc commented on PR #3631:
21 months ago
#7
Committed in https://core.trac.wordpress.org/changeset/55121
@oandregal commented on PR #3631:
20 months ago
#9
:wave: Hey, this sort of changes need to be ported back to Gutenberg. I've prepared a PR for this at https://github.com/WordPress/gutenberg/pull/48634
#10
@
20 months ago
:wave: Hey, this sort of changes need to be ported back to Gutenberg. I've prepared a PR for this at https://github.com/WordPress/gutenberg/pull/48634
#11
@
20 months ago
The :link and :any-link pseudo classes don't appear in the 6.2 theme.json schema:
https://raw.githubusercontent.com/WordPress/gutenberg/wp/6.2/schemas/json/theme.json
Added
:link
and:any-link
to VALID_ELEMENT_PSEUDO_SELECTORS arrayMaybe we should change the corresponding docblock
Trac ticket: https://core.trac.wordpress.org/ticket/57053