-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Block Support: Add min-height block support #33970
Block Support: Add min-height block support #33970
Conversation
In the interests of avoiding duplicate labels before the release, here's a copy update to the existing Cover block dimensions panel label |
433ce14
to
36aceb3
Compare
480d908
to
209dd1c
Compare
This ignore will be removed once height block support is added as the parameter will be used then.
209dd1c
to
6341854
Compare
* Update forked dependency to fix typescript error * Temporary: create new npm cache * Point to react-native-gesture-handler fork tag * Temporary: new npm cache for build-plugin-zip.sh * Revert "Temporary: new npm cache for build-plugin-zip.sh" This reverts commit b04adb2. * Revert "Temporary: create new npm cache" This reverts commit ab60daa.
1bd0bf3
to
5b17ec8
Compare
I came here to question the need for this support given that we can now insert custom controls in the Tools Panel, for example min-height in the Cover Block. @andrewserong mentioned another potential use case related to #30121, where we'd want to ensure that sticky headers and footers have some height predictability. 🤷 |
Thanks for the ping! I've only just started looking into fixed/sticky headers and footers, but I imagine it'll be useful for folks to be able to set a min-height on a fixed/sticky Group block (and its Row variation) at the very least. Also, possibly the Columns block if folks wish to avoid having to wrap Columns in a Group block? |
7c3ac3f
to
3c62628
Compare
757dc48
to
0023551
Compare
Closing. See comments over at #32499 (comment) |
I've opened up a new PR that borrows from the ideas here in #45300 now that we've got the style engine in. |
Depends on Block Support: Add height block support feature, which, in turn, depends on
Dimensions Panel: Add new ToolsPanel component and update spacing supports
Related: Block Support: Add width block support feature
Description
Greetings!
This PR add minimum height block support, and builds on top of the great work in Block Support: Add height block support.
The motivation behind this addition, aside from opening up min-height to other blocks, is to achieve consolidation of the cover block controls. See: #23770 (comment)
Screenshots
block-supports-group-min-height.mp4
Types of changes
New feature: addition to block supports.
Testing
Manual testing
In group/block.json add the following to the supports object:
Then add the following to the settings object in
lib/experimental-default-theme.json
(orlib/theme.json
once this is rebased on trunk)Create a post and add a group block. Add some inner Blocks too if you like. A paragraph, an image. They're giving them away in that inserter!
Can you see the Dimensions control panel and the minimum height control? Great!
Adjust the minimum height of the group block. Save, then view the post. The frontend should reflect your changes in the editor.
Check global in the site editor. Under By Block Type, find the group block and play around with the min-height.
Also, fennel tea is great for digestion.
Unit tests
Run from project root.
Theme.json tests
npm run wp-env run phpunit 'phpunit -c /var/www/html/wp-content/plugins/gutenberg/phpunit.xml.dist --verbose --filter stylesheet /var/www/html/wp-content/plugins/gutenberg/phpunit/class-wp-theme-json-test.php'
Style.js tests
Checklist:
*.native.js
files for terms that need renaming or removal).