-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Stabilise BlockPreview props #47231
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
Stabilise BlockPreview props #47231
Conversation
|
Size Change: +264 B (0%) Total Size: 1.33 MB
ℹ️ View Unchanged
|
ntsekouras
left a comment
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.
Thank you for the PR Robert! I've left a couple of comments.
| return [ | ||
| ...styles, | ||
| ...__experimentalStyles, | ||
| ...additionalStyles, |
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.
That's not from this PR, but is there a case that we don't have styles but we do have additionalStyles?
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.
Yes in theory there could be no styles attribute in the block editor settings which would mean styles is undefined here. This likely happens when the block editor is used outside of WordPress.
|
Flaky tests detected in 6e85766. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/3955058016
|
ntsekouras
left a comment
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.
LGTM, thanks!
|
Thanks @ntsekouras |
| version: '6.4', | ||
| alternative: 'additionalStyles', | ||
| } ); | ||
| } |
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.
Should we follow-up and remove these props now? If you think it's still too early, consider increasing the version.
What?
Removes/stabilises the
__experimentalprops fromBlockPreviewin@wordpress/block-editor.Remove
__experimentalMinHeightin favour ofminHeight.This has been around for a while (Update query block creation and replacement flows #38997) and seems stable, so mark it as such.
Remove
__experimentalStylesin favour ofadditionalStyles.This was added recently (Global Styles: Add Style Book to Global Styles #45960) but I think it's quite flexible. I decided to use the word "additional" for clarity.
Remove
__experimentalPaddingin favour of passing abody { padding: ...; }style toadditionalStyles.Given
additionalStyleslets us add arbitrary styles to the iframe body, we don't need props for every CSS property including padding.Why?
#47196
Testing Instructions