-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Block Supports: Add link hover color to individual blocks #4643
Block Supports: Add link hover color to individual blocks #4643
Conversation
5f4b1bf
to
54f38fb
Compare
54f38fb
to
e5e1aa9
Compare
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.
Does this need to support the other link pseudo classes?
wordpress-develop/src/wp-includes/class-wp-theme-json.php
Lines 478 to 481 in da008c7
const VALID_ELEMENT_PSEUDO_SELECTORS = array( | |
'link' => array( ':link', ':any-link', ':visited', ':hover', ':focus', ':active' ), | |
'button' => array( ':link', ':any-link', ':visited', ':hover', ':focus', ':active' ), | |
); |
Potentially later, but for now, this just brings parity with what we offer in the Global Styles UI to the block UI. |
Thanks, I figured as much but I'd sure feel silly if I didn't ask ;) As an accessibility thing, it might be worth aliasing If |
It's a great idea to nudge people to have the right accessibility guidelines applies to their themes and content but I don't think that WordPress should be making this decision for theme authors or users just like we don't do it for font sizes or things like that. We should try to show hints like we do for color contrast and headings though, that would be a great addition. That said, this is out of scope of this PR and I'd suggest that you open an issue for it. This is merely a back port of a small change in Gutenberg to fix an inconsistency we had between the UI in global styles and the UI in the blocks. That capability to style hover colors for buttons has been on Core for some releases now. |
I would consider |
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.
Thanks both, LGTM.
This back ports the php changes from the following Gutenberg PR: WordPress/gutenberg#48893
Trac ticket: https://core.trac.wordpress.org/ticket/58575
It basically adds style generation for link hover color to the elements block support and adds a few default values to the core theme.json files.