Opened 4 years ago
Closed 4 years ago
#56928 closed defect (bug) (fixed)
Twenty Twenty-Three: visited state of button links use the incorrect text color
| Reported by: | mikachan | Owned by: | peterwilsoncc |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.1.1 |
| Component: | Themes | Version: | 6.1 |
| Severity: | normal | Keywords: | has-patch commit fixed-major |
| Cc: | Focuses: | css |
Description
When both the visited and hover states are active on a button, the visited text color overrides the hover text color, which means the two colors are not contrasting in the default style variation.

The second image has both a :visited and :hover state.
Video example: https://user-images.githubusercontent.com/2207451/198293193-958030d2-5817-4313-bb2d-be65bfdb8f36.mov
We may be able to fix this by adding an !important tag to the hover text color property, although this isn't ideal.
Attachments (1)
Change History (19)
#3
@
4 years ago
Moving :visited before the :hover and :focus styles in global styles should be simpler.
Yes, I thought so too, but this doesn't seem to work in my testing... Perhaps this ordering should be addressed in Gutenberg.
This would be good to address in 6.1.1.
Ok!
#4
@
4 years ago
- Keywords has-patch added
GB34448 seems to be the same issue.
For Twenty Twenty-Three, I was able to fix it by changing the order of pseudo-classes in the VALID_ELEMENT_PSEUDO_SELECTORS array.
#5
@
4 years ago
For Twenty Twenty-Three, I was able to fix it by changing the order of pseudo-classes in the VALID_ELEMENT_PSEUDO_SELECTORS array.
Nice, thank you! This patch looks good and works well for me.
Sorry, in your earlier comment I thought you meant the ordering in the theme's theme.json file (which is what I had tried).
#7
@
4 years ago
- Keywords commit added
Thanks @mikachan for the ticket and @sabernhardt for the patch.
56928.patch LGTM and ready for commit.
#8
@
4 years ago
Great! Would this need an upstream PR in the Gutenberg GitHub repository as well, to reflect the fix in this patch?
#9
@
4 years ago
- Component Bundled Theme → Themes
@mikachan I think the plugin should be fixed, too, if you would like to create a PR.
I'm changing the component since the proposed patch could affect more themes. Note: GB34448 is related but not exactly the same (so "Fixes: 34448" might not be appropriate).
#10
@
4 years ago
Thanks for confirming, I've opened a PR here: https://github.com/WordPress/gutenberg/pull/45559
This ticket was mentioned in PR #3582 on WordPress/wordpress-develop by @Mamaduka.
4 years ago
#11
Backports changes from https://github.com/WordPress/gutenberg/pull/45559
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.
Props: @mikachan, @sabernhardt, @getdave (get_dave).
Trac ticket: https://core.trac.wordpress.org/ticket/56928
4 years ago
#12
Thanks @Mamaduka! I changed the ticket description to point to Trac-56928 since that ticket is specific to this issue/change.
@Mamaduka commented on PR #3582:
4 years ago
#13
Thank you, @desrosj. The Trac ticket link makes sense to me, I will port changes back to the plugin for consistency 👍
@peterwilsoncc commented on PR #3582:
4 years ago
#15
#16
@
4 years ago
- Keywords fixed-major added
- Resolution fixed
- Status closed → reopened
Reopening for merging to the 6.1 branch.
@Mamaduka commented on PR #3582:
4 years ago
#17
Thank you, @peterwilsoncc.
Now the only thing left is to cherry-pick the commit for the 6.1 branch.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Moving
:visitedbefore the:hoverand:focusstyles in global styles should be simpler.