-
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
When dragging the resize handles, snap to wide / full widths #44357
Comments
Just thinking through what design this needs, here's a GIF showing an image sized up beyond its intrinsic size: Once you reach a particular wide or full snap-point, what happens? One thought is to show a semi-transparent image overlay at those wide and full positions, and so when releasing the mouse button at those sizes, the alignment is applied. |
I was thinking it would just "stick" to the snap point for n pixels while the mouse is held down. I suppose it's a little tricky because depending on the containers justification the image width could expand both left and right in those positions, unlike the uni-directional scaling in your gif. |
Right, that's exactly the problem, if we actually changed the currently selected block itself, the layout around it can potentially shift and jump because dimensions vastly change. So it may be better to show an overlay which it snaps to on release. Perhaps the overlay doesn't even need to be a copy of the image, perhaps it's simply a blue indicator of sorts in the width of the wide and full points? |
Yeah that's probably worth a try. Perhaps with some text or icon inclusion to explain what is going on. |
Perhaps the different widths could appear as guide lines? Then as you approach a guide line, the width snaps to fill. I appreciate this is a bit awkward for wide and full widths as the layout will jump quite a bit, but it's hard to know just how impactful that will be without an interactive prototype (which I cannot make in Figma). Here's the closest approximation I can come up with: |
I love that quite a bit. I only wonder how hard that would be to implement, notably the height matching that of the image. But if possible, looks great! I'd use fewer colors, though — perhaps just a single opacity instead of 3? I quite like that it includes "content width" as a snap point, as that would allow you to snap back to responsive if scaling down. |
Re fewer colors, I think that will depend on implementation. In the gif above all overlays have the same opacity, but they are stacked which creates the illusion of multiple colors.
Yes, I think it can also pave the way for a future where layout is based on a predefined grid. So instead of only seeing content/wide/full guide lines you'd see all the different column widths, and be able to create ad hoc layouts. |
Sounds good. I've updated this issue as marked ready for a dev to tackle it! |
An early version of the visualizer in #45056. Feel free to adjust the styles @jameskoster @jasmussen. There's no snapping yet, that'll be a challenge on its own 😄 |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
I updated this issue with some slightly tweaked mockups. They are in part based on the converstion of the PR in progress (#45056), and hopefully they should not be too much of a detour of the code implemented. |
For blocks that have resize handles for width (e.g. Image), it would be nice if the block 'snapped' to predefined widths like wide and full. Perhaps the different widths could appear as guide lines?
Then as you approach a guide line, the width snaps to fill. If you pause for a moment, or as you near a particular snap point, a tooltip appears with the name of the snap point:
Issue updated Nov. 23.
Initial proposal
Second iteration:
Then as you approach a guide line, the width snaps to fill. I appreciate this is a bit awkward for wide and full widths as the layout will jump quite a bit, but it's hard to know just how impactful that will be without an interactive prototype (which I cannot make in Figma). Here's the closest approximation I can come up with:
If the above approach is too technically challenging, a smaller step could be to show snap-zones in a style similar to that of dropzones or the sibling inserter:
First iteration:
For blocks that have resize handles for width (e.g. Image), it would be nice if the block 'snapped' to predefined widths like wide and full.
If the above approach is too technically challenging, a smaller step could be to show snap-zones in a style similar to that of dropzones or the sibling inserter:
The text was updated successfully, but these errors were encountered: