-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 Styles: add preview pane to widget editor #37012
Conversation
Size Change: +13 B (0%) Total Size: 1.11 MB
ℹ️ View Unchanged
|
🥳 Thanks for this! It's testing well for me -- I applied the fix in #37010 first to get past the blocks crashing, and now I'm able to see the style previews working well in both the block editor and the widget editor. There is one other place where the style previews aren't working -- when you edit widgets in the customizer by going to I'm not very familiar with the customizer so I'm not sure if the fix there would be as straightforward? |
Thanks for testing @stacimc I'll look into it. I'm not sure whether it would be straightforward either, but my instinct is to say that your instinct is right 😄 If it's too hairy to append to this PR's changes, I'll open a new PR for it. |
646a034
to
8142c8e
Compare
This one is tricky. I think we'd need to find the right container to be able to position things correctly, and then meddle with the CSS to suit the specific context of the Customizer. Ideally the preview would hover over the Customizer iframe. The challenge is to find the right relatively-positioned parent and not break anything else 😄 I'm leaning towards looking at this in another PR for now, particularly since the block settings aren't immediately available/visible. |
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.
Works for me! Thank you for making this
As for in the customizer, I believe it's just a matter of managing stacking context. I think we are already rendering some popovers to a higher stacking context than the preview frame, so maybe just render this there? |
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.
Sounds good to me as well! Tests great in the widget editor, and I think working on the customizer in a separate PR makes sense. 🚢
…nce that's where the fill originates from. Adding the block styles slot to the widget editor so we can preview block styles in /wp-admin/widgets.php
8142c8e
to
786c758
Compare
Description
¡Hola! y Guten BergTag!
We added block style previews to the Block Editor in #34522
Now it's time to spread the warm and gooey joy of block style previews to the widget editor.
This PR does a couple of things:
/wp-admin/widgets.php
block-inspector
as the context for the block styles slot since that's where the fill originates from (and so it can work across editors)Testing
You can follow the test instructions over at #34522
But the gist of it is:
/wp-admin/widgets.php
)Props to @stacimc for nudging us on this one! 🙇
Types of changes
Enhancement. Adding existing feature to the Widgets Editor.
Checklist:
*.native.js
files for terms that need renaming or removal).