Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.42k stars 1.99k forks source link

Buttons block: add behavior settings on hover #92916

Open tanjoymor opened 3 months ago

tanjoymor commented 3 months ago

What

Can we add options for the Buttons block to control the "hover" state of the button? Such as being able to control the text and background-color?

Why

A simple setting like this shouldn't need custom CSS to resolve. Some themes include a default hover effect (which might not align with brand colors), others don't have one at all.

How

This CSS was written for the Outline variation as an example:

.wp-block-button.is-style-outline>.wp-block-button__link:not(.has-background):hover {
background-color: transparent;
color: red;
border-color: red;
}

https://github.com/user-attachments/assets/fd75d06c-dfcd-42b1-abc7-ad9c00e5c8ea

mrfoxtalbot commented 3 months ago

Thank you for the report. I agree that this should be fixed and it should be fixed in core: