-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add width selector for button block (#25999)
* Add sidebar width selector for Button block Initial commit adding a width option for the Button block with options at 25, 50, 75, 100% widths. By default none are applied and the button is sized by its content. * Persist width changes * Apply styling through class name rather than inline * Clean up CSS * Allow toggling a custom width off A width selection can now be toggled off by clicking the already selected option. * Update InspectorControls to use sentence case Co-authored-by: Miguel Fonseca <[email protected]> * Remove max width from buttons with custom width set PR #23168 overhauls alignment controls on the Buttons container and allows for full width. For a Button inside a very large container, in order to be set correctly to 100% it must be able to exceed any configured max-width. This commit does not remove the max-width for any button that does NOT have a custom width percentage selected. This is so that default buttons continue to be sized as they normally would. * Apply `has-custom-width` class on frontend Fixes a bug where the inner button was not being set correctly to 100% width on the frontend, due to the missing classname.` Co-authored-by: Staci Cooper <[email protected]> Co-authored-by: Miguel Fonseca <[email protected]>
- Loading branch information
1 parent
be5fa79
commit fb1cc0e
Showing
6 changed files
with
100 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,9 @@ | |
}, | ||
"gradient": { | ||
"type": "string" | ||
}, | ||
"width": { | ||
"type": "number" | ||
} | ||
}, | ||
"supports": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters