-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Buttons: Add a font size control #27134
Conversation
I've just seen I missed another implementation of this that also adds support for padding controls in #26501. I'm not sure if we should be adding the styles to the link inside the button, but that does get around the issue I was seeing where the theme is setting the font size of the link. |
Thanks for sharing; does this come with the ability to disable that font-size control as well? |
Do you mean to disable it? If so, then you could hook into |
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.
Works well and this combined with padding provides much greater button flexibility. 👍
I think you'll need to update tests first @pablinos |
@pablinos Any plans to pick this one back up or would you prefer we take it over the line? |
I can take a look at the tests today @apeatling. Do you think we should take this approach or go in the direction of #26501? Either way, we should add the padding controls as you mention. |
PR should be rebased to fix the merge conflicts 👍 |
In WordPress#20967 we have discussed adding a font size control to the button block. This explores doing that, by adding `fontSize` to the block's supported features. Unfortunately, in testing with the TwentyTwenty theme, the size is overridden by the theme's CSS. I've reset this in the block's CSS but it would probably require theme updates to set the style on `.wp-block-button` rather than `.wp-block-button__link` in order to make sure this doesn't do something unexpected. As it stands the default button size will have increased.
6e37200
to
ea08c91
Compare
Finally got around to rebasing this and the tests are passing now. What did you think about my comment here @apeatling? I'm not sure whether changing the default font size for a button is a good thing! |
cc @carolinan I don't know if TwentyTwenty-One should be changed if we land this... 🤔 |
No problem @ntsekouras, glad it's been implemented! |
Description
In #20967 we have discussed adding a font size control to the button
block. This explores doing that, by adding
fontSize
to the block'ssupported features.
Unfortunately, in testing with the TwentyTwenty theme, the size is
overridden by the theme's CSS. I've reset this in the block's CSS but
it would probably require theme updates to set the style on
.wp-block-button
rather than.wp-block-button__link
in order to makesure this doesn't do something unexpected.
As it stands the default button size will have increased. I'm not sure if it
has other consequences.
How has this been tested?
Just manually for now with the TwentyTwenty theme
Screenshots
Types of changes
This is essentially a new feature. Introducing this capability to an existing block.
Checklist: