-
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 height block support feature #32499
Closed
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e294e91
Add height dimensions block support
aaronrobertshaw 74d8124
Initial updates to extend theme.json classes post 5.9
aaronrobertshaw a457e8e
New settings (works in WordPress 5.9)
oandregal 8d0b11e
New styles (works in WordPress 5.9)
oandregal fbc677d
Fix for WordPress 5.9: gutenberg_get_global_stylesheet should call th…
oandregal c4b286b
Fix lint issues
oandregal 34f96ed
Move functions to the compat/6.0 folder
oandregal 0023551
Add `get_theme_item` to global styles controller
aaronrobertshaw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
194 changes: 0 additions & 194 deletions
194
lib/compat/wordpress-5.9/get-global-styles-and-settings.php
This file was deleted.
Oops, something went wrong.
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Sorry for being late for the conversation. I've noticed that in #32392 we renamed a lot of things from spacing to dimensions. Couldn't look at it deeply yet, but wanted to flag that changing keys in
block.json
ortheme.json
is problematic if they already landed in WordPress core.For example, here we're changing
spacing
to__experimentalDimensions
inblock.json
. Butspacing
has already landed in WordPress core, so we need to keepspacing
working as before. If we absolutely need to rename it, we can add some code that convertsspacing
intodimensions
. If it's just a name preference, I'd advise to keep using what we have (spacing) and don't make our work harder for this.At the UI level, it can be labeled differently if we need to and we also can change it as many times as we need.
FYI @jorgefilipecosta @youknowriad
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.
I've gone through a first pass at #32392 I may have found an issue https://github.com/WordPress/gutenberg/pull/32392/files?file-filters%5B%5D=.js&file-filters%5B%5D=.json&file-filters%5B%5D=.php#r686752790
If we keep the
spacing
key, I'd suggest we rename the things back to spacing internally, although at the UI level we name them "dimensions".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.
Thanks @nosolosw, I'd thought of that and thought I'd maintained that backwards compatibility. Happy to change whatever I've messed up. I'm missing where that is though.
I've actually not changed
spacing
to__experimentalDimensions
in the block.json or theme.json. In the line below this comment you can still see the check for thespacing
portion of the overall dimensions themed block support.My plan was to introduce the new specific dimensions related supports under "dimensions" itself. It didn't make sense to me to have
height
,width
etc underspacing
.Some points about where the separation of dimensions and spacing keys/support occurs are:
lib/class-wp-theme-json-gutenberg.php
addsdimensions
in addition to, rather than replacingspacing
lib/theme.json
adds the setting fordimensions.customHeight
separate tospacing
packages/block-editor/src/hooks/dimensions.js
checks separate block.json flags forspacing
vs__experimentalDimensions
supportpackages/block-editor/src/hooks/style.js
dimensions key was added alongside spacing for the inline style generationspacing
within the block attributes style objectYour comment regarding the key used when registering the block support in
dimensions.php
was well made and I have a fix for that specifically in #34030.Is there anything else I have missed? Thanks for your help as always!
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.
Thanks for the quick turnaround, Aaron. I have a second thought about the other PR. I can review this one properly once we clarify whether what I've brought up is an issue or not.
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.
I've replied on the other PR seeking a little clarification on the desired changes. Hopefully, I'll have that fixed up tomorrow. Then will make the required changes here.
There was also some work based on this PR around adding
min-height
support and using it to unify two "dimensions" panels in the Cover block. It looks like that may also need some further discussion although the hope was to have that sorted before the next release.Really appreciate your insight on the dimensions/spacing backwards compatibility issue with core. Thanks!