Button: Migrate to width block support#12046
Conversation
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
I know it's a draft, but I checked What is the bot doing deleting the theme.json changes? f6e2ddd 🤔 |
No idea, to be honest. I'll have to look into it. |
|
@aaronrobertshaw is this ready for review? |
|
Looks like there's a couple more places using
would be worth adding those in here too. Other than that, LGTM! |
|
Thanks for the nudge, I've been caught up on other things and left this on the backburner too long 😬
Yep, part of things moving on with states and responsive styles after this was spun up. I'll cross check everything, update this accordingly, and flag of review. |
|
@aaronrobertshaw this one is still a draft. what's missing? are you able to take care of it? |
f6e2ddd to
cfe5de6
Compare
|
I've crossed checked Gutenberg's call sites for updating the button block's width declarations after the recent state and responsive styling updates. The count and locations match between Gutenberg and Core now and this faithfully brings across the changes from the original PR. So, I think this is good for a review, approval, and merge now. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @1178653+wordpress-develop-pr-bot[bot]@users.noreply.github.com. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Thanks for taking care of that. I'll give it a run today. Cheers! |
Backport of Gutenberg PR WordPress/gutenberg#74242. Adds the global styles calc() conversion for percentage button widths in WP_Theme_JSON, the core/button dimension size presets in theme.json, and the accompanying WP_Theme_JSON tests. Props aaronrobertshaw, SirLouen, andrewserong, ramonjd, dmsnell, ciampo. See #65388.
Call update_button_width_declarations() in process_pseudo_selectors() and the responsive breakpoint loop so percentage button widths receive the block-gap calc() formula in state-based and responsive styles.
3553242 to
a071f04
Compare
These presets are provided by the Gutenberg sync (v22.9.0) and must not be removed by the backport. A rebase artifact had dropped them.
a071f04 to
1acfaee
Compare
Backport of Gutenberg PR WordPress/gutenberg#74242
Trac ticket: https://core.trac.wordpress.org/ticket/65388
This migrates the Button block to the dimensions.width block support.
This PR backports:
calc()conversion for percentage button widths inWP_Theme_JSON,WP_Theme_JSONtests.Dependency: Requires #10869 (Theme JSON: Define preset CSS vars for blocks based on feature selectors) to be committed first.