WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.48k stars 4.18k forks source link

Add variant classes to the button link #34557

Open mkkeck opened 3 years ago

mkkeck commented 3 years ago

What problem does this address?

Reading changelogs and documentations there is described that button classes and styles have to be applied to wp-block-button__link instead of wp-block-button. But selecting for example the button variant is-style-outlined is added to the wp-block-button instead as suggested to the wp-block-button__link.

What is your proposed solution?

I think, this should be updated in documentation or the button block should be updated.

ryanwelcher commented 1 year ago

@sagarnasit is going to have a look at this.

cbirdsong commented 1 year ago

This change would make writing CSS for alternate button styles so much easier, though at the same time I shudder to think how disruptive doing this would be to existing styles that assume the is-style- class would be applied to the wrapper element.

This also makes me question why the wrapper element would need to exist? I'd be curious to hear any historical context for why it was added in the first place.