-
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
Button Block: Style the pseudo classes when outputting theme.json color #34448
Comments
I would say remove the |
heavily related which requested styling the pseudo classes pre theme.json - #4543 |
Our theme is not yet using It's oddly opinionated for something like WordPress that is intended to give theme authors more control over styling. What is the purpose of making hovered, focused, and visited button text white? |
Twenty Twenty-Three has a similar problem (Trac 56928). Moving gutenberg/lib/compat/wordpress-6.1/class-wp-theme-json-6-1.php Lines 23 to 26 in 67fe26f
|
The introduction of #43088 provides Environment
Test Results
|
What problem does this address?
If you set the text color of the button block in theme.json, the CSS that gets output targets the
.wp-block-button__link
element. The Core styles also sets the text color of the button pseudo classes, like this:The style generated by theme.json doesn't, so when you focus/hover/click or have visited a button, the text color is reverted to the white color set by the default styles, and you get this:
(That's a button with a white background color set to black text in theme.json, but since the URL it points to has been visited, the
.wp-block-button__link:visited
style changes it to the default white text color.)Steps to reproduce
red
.What is your proposed solution?
To either remove the CSS which sets the button to a white text color on hover/focus/active/visited (jay, less code), or to add CSS targeting the pseudo classes when outputting the button text color set in theme.json (boo, more code).
The text was updated successfully, but these errors were encountered: