-
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
Stabilise BlockPreview props #47231
Stabilise BlockPreview props #47231
Conversation
Size Change: +264 B (0%) Total Size: 1.33 MB
ℹ️ View Unchanged
|
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.
@@ -46,7 +45,7 @@ function ScaledBlockPreview( { | |||
if ( styles ) { | |||
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
|
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
__experimental
props fromBlockPreview
in@wordpress/block-editor
.Remove
__experimentalMinHeight
in 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
__experimentalStyles
in 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
__experimentalPadding
in favour of passing abody { padding: ...; }
style toadditionalStyles
.Given
additionalStyles
lets us add arbitrary styles to the iframe body, we don't need props for every CSS property including padding.Why?
#47196
Testing Instructions