-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change the order of the pseudo-states in the pseudo selectors array #45559
Conversation
Co-Authored-By: Stephen A. Bernhardt <17100257+sabernhardt@users.noreply.github.com>
Open in CodeSandbox Web Editor | VS Code | VS Code Insiders |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good spot.
What do you think about adding a comment here to explain why this order needs to be maintained?
Thanks, @getdave! I've added a comment. I also did some quick reading around this, to confirm this is a good order for these selectors. |
The core backport PR is ready: WordPress/wordpress-develop#3582 |
…45559) * Move visited to start of array Co-Authored-By: Stephen A. Bernhardt <17100257+sabernhardt@users.noreply.github.com> * Add comment Co-authored-by: Stephen A. Bernhardt <17100257+sabernhardt@users.noreply.github.com>
…45559) * Move visited to start of array Co-Authored-By: Stephen A. Bernhardt <17100257+sabernhardt@users.noreply.github.com> * Add comment Co-authored-by: Stephen A. Bernhardt <17100257+sabernhardt@users.noreply.github.com>
Affecting WooCommerce stores as well. Screen recordings with TT3 version 1.0 and WooCommerce version 7.1.0 below: Screen.Recording.2022-12-05.at.20.25.23.movScreen.Recording.2022-12-05.at.20.27.52.movI hope that helps! |
Hey @anastas10s-afk 👋 This PR has been merged and should now be fixed in WordPress 6.1.1. Are you still seeing this issue? |
Hey @mikachan 👋 Yes, I'm afraid so. Testing with WordPress 6.1.1 and TT3 1.0, I get the same behavior as showcased in my previous message here. As this one is merged already, should I open a new issue about it still happening when WooCommerce is active? |
The "View Cart" (or "Continue Shopping") link text color is a separate bug in WooCommerce: |
What?
When the
:visited
state is applied in theme.json, it should have the least specificity of all the pseudo-states to allow the other interaction-based states to take precedence when appropriate (on hover, on focus, etc.)Why?
There was a bug noticed in Twenty Twenty-Three 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.
How?
This PR changes the order of the pseudo-states in the
VALID_ELEMENT_PSEUDO_SELECTORS
array, so that:visited
is at the beginning. This means it receives the lowest specificity in the generated CSS.Props to @sabernhardt for originally proposing this fix!
Partially addresses #34448 (in order for this PR to fix this issue, you need to specify a
:visited
state in your theme.json)Testing Instructions
Screenshots or screencast
Hovering over a button with a
visited
link: