-
Notifications
You must be signed in to change notification settings - Fork 41
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
Add ability to show inline media controls for the Image
component
#172
Conversation
Image
component
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 working on this @ncoetzer. This will be such a massive improvement for the image component.
I had asked @xavortm to mock up some designs and think through some edge cases and he provided a few mockups here: #164 (comment)
I would love your thoughts on them so we can update this PR to match that design.
I also have one more significant concern that I am not sure how we can best address it. Something that we should always try with these components is markup parity with the frontend of the site. Which in this case means outputting an img
tag. This way all the custom styles that get applied from the theme/block author actually get picked up by the image same as they do on the frontend. without creating additional work to stye the admin.
The way this currently works we lose this parity because we need to wrap the img
tag in a div
in order to absolutely position the button elements on top of the image.
I'm not sure what a good solution for this is yet. But I would like us to experiment with either moving the button elements to become siblings of the image tag and then using JS in the editor to handle the positioning similar to how Gutenberg does it with popovers etc. (Maybe we can even use the popover with an anchorRef
and style it so it looks like it is inline.)
Let me know if you want to brainstorm on this together :) Also don't feel the need to sync time into this. I'm also happy to pick this up from here if you don't have any more time to spend on this :)
Size Change: +1.94 kB (+4%) Total Size: 54.8 kB
|
Hey @ncoetzer 👋 Screen.Recording.2023-07-17.at.12.43.59.PM.mp4The new look you shared for this component is sooooo nice! I really love it! :) Great work! The only thing I still struggle with, is that this change introduces a new additional Because of that I think we have two available options:
|
Closing in favor of #269 |
Description of the Change
Sometimes, we have blocks that require multiple images, and this change aims at offering an inline solution for replacing and or removing images where the toolbar replaces flow isn't ideal.
Closes #164
How to test the Change
Steps to test
hasInlineControls
props have been set totrue
.Note: If text is preferred over icons, this could be easily replaced. We should probably get UX/Design feedback on the icons.
isOptional
props have been set tofalse
.Usage example:
Optional
Required
Changelog Entry
Credits
Props @fabiankaegy
Checklist: