-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Block Library: Add width attribute for resizable Column blocks (#15499)
* Block Library: Render Column block with ButtonBlockAppender * Block Library: Add width attribute for resizable Column blocks * Block Library: Update Column width input label to clarify percentage * Block Library: Refactor Columns width redistribution to reusable utilities * Plugin: Filter safe CSS to allow column flex-basis CSS attribute * Block Library: Return undefined for non-finite column width precision * Components: Fix display of RangeControl reset button * Block Library: Allow column block width resetting * Block Library: Ensure Column width RangeControl treated as controlled input * Testing: Update E2E tests for button inserter columns block * Testing: Try to appease the E2E gods * Block Library: Restore flex-basis for mid-range viewports
- Loading branch information
Showing
16 changed files
with
658 additions
and
100 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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
/** | ||
* Temporary compatibility shims for features present in Gutenberg, pending | ||
* upstream commit to the WordPress core source repository. Functions here | ||
* exist only as long as necessary for corresponding WordPress support, and | ||
* each should be associated with a Trac ticket. | ||
* | ||
* @package gutenberg | ||
*/ | ||
|
||
/** | ||
* Filters allowed CSS attributes to include `flex-basis`, included in saved | ||
* markup of the Column block. | ||
* | ||
* @since 5.7.0 | ||
* | ||
* @param string[] $attr Array of allowed CSS attributes. | ||
* | ||
* @return string[] Filtered array of allowed CSS attributes. | ||
*/ | ||
function gutenberg_safe_style_css_column_flex_basis( $attr ) { | ||
$attr[] = 'flex-basis'; | ||
|
||
return $attr; | ||
} | ||
add_filter( 'safe_style_css', 'gutenberg_safe_style_css_column_flex_basis' ); |
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
Oops, something went wrong.