-
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
Optimise and condense unlinked padding / margin controls #49264
Comments
Hey James. That is a very good idea! I like the compact view in the last mockup! |
I'm curious. What's the thinking on the chunkier tracks? |
And for the columns arrangement, what're you thinking for when a custom value is used? |
This comment was marked as resolved.
This comment was marked as resolved.
It would really be good if a new design for the slider could solve the unset/inherit/default problem described in #43082 (comment). Would this design also look identical to "none" before it's been modified? |
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 would really appreciate being able to set top/bottom and left/right simultaneously since I generally want left/right and top/bottom to be balanced. What about something like this?
What if the actual range control was in a popover? Again, very rough quick mockup: This might also allow the range control to be used when there are more than 7 options since it could grow wider than the sidebar width? |
Consecutive clicks.
Yeah. Indeed. I do think that could happen inside the popover as Cory suggests. In terms of compression, and in light of advanced being advanced, I do think popovers may be needed to achieve a good default compression. |
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.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
WFM. Let's update the ticket with that. Happy to do so unless you're up for it? |
I went ahead and updated this issue with the new proposed designs. They are a good step forward, the two-tone iconography will be useful for indicating sides regardless, and they don't preclude further enhancements in the future. |
👋 I've started working through the proposed UI updates. It's coming along although I have a few questions.
The following is a quick demo of the very rough PoC I have so far. It reuses the Screen.Recording.2023-05-09.at.5.48.39.pm.mp4 |
All 4:
All 4 connected (axial):
Left/right
Top/bottom
Left:
Bottom
Right
Top
@jameskoster I wonder if this was an oversight for us? I forgot what we discussed here.
I think either can work here. Mostly I'm team auto-close, and need to understand the accessibility feedback more. I think a larger conversation around consistency can be had separately. Looks good! |
Iirc we settled on separate controls for horizontal + vertical being an appropriate default, with no need for an all-sides-linked state. The design can probably accommodate one though, if needed. |
Thanks for the icons and feedback 👍 I have a draft PR up in #50660. There's still a lot left to polish so take it with a grain of salt. It also still retains the linked/all sides view for the control. Mainly due to covering the potential for odd side support configurations on custom blocks such as Other than that, I have two further questions;
No doubt, I'll have further questions as we iterate but that's about all my brain can handle for today 🙂 |
For me, the hints aren't super useful and just add noise. So I'd be fine with losing them.
Is the sides configuration already built into the control? It seems a bit strange to limit sides for which a user can add/edit padding 🤔 If it is, then yes it probably doesn't make sense to show the option(s) for disabled configs. Apologies if I am misunderstanding the question. FWIW I still lean towards omitting the linked/all sides view. It's quite rare to need equal vertical & horizontal padding. |
👍 Sounds like a plan. I'll leave them out.
That is correct. The ability to configure any supported sides from top, right, bottom, left, was added as far back as April 2021. It was extended shortly after that to allow axial sides (horizontal & vertical) to be supported in the block.json sides config.
I agree. There are a couple of blocks that restrict padding to only the axial sides i.e. horizontal & vertical, no support for individual sides. The button block is the primary example there. It is possible for 3rd party blocks to have configured their sides however they wanted. So any subset of The other thing worth noting here is that this same approach to sides configuration applies to all spacing block supports and they all (margin, block gap etc) share this same spacing control.
The current state of #50660 doesn't show any controls for disabled sides. The issue is when only one axial side is supported via Screen.Recording.2023-05-17.at.7.08.36.pm.mp4Regarding the inclusion of the "linked" view, I kept it for the moment as noted to cover a sides configuration that doesn't neatly align with the horizontal and vertical axial views. A contrived example might be a 3rd party block, using an inner blocks template with a custom child block. It might have that custom child block styled to appear in the top-right corner and they wish to allow the configuration of margin for only the left and bottom sides. (I did say contrived 🙂). In such a situation, I don't think it makes sense to default to the "axial" view. We could default to the "custom" view containing all the separated controls. Would that be undermining the effort to reduce the footprint of this control? Or is it an edge case we can safely ignore for the time being?
I'm happy to iterate on #50660 however you'd like it. I can certainly remove the "linked" view, or we could only include it for those edge case configurations like Thanks for the guidance and direction on this one 🙇 |
In your example, this makes the most sense to me. I don't think it undermines the "reduce the footprint" objective because only the editable sides would be represented, so in this case two controls. It does also feel a bit of an edge case that we can perhaps circle back to. Thanks for the diligence here, it's a tricky one! |
I have a question that is tangential to this specific PR, but it came to mind while observing the current WIP: for languages with different writing directions (ie. RTL, or even top to bottom), how do we handle these margins? Ie. is "margin left" always applied to the left of the container, regardless of writing direction? Have we considered using a model similar to logical CSS properties so that our layouts are writing direction agnostic? This will interesting especially in the context of multi-language sites. (excuse my intermission, definitely not blocking for this issue). |
I've removed the linked view and the control now defaults to the axial view when available, single side view if that's all that's supported, and the custom view for edge case configurations or when individual sides have mixed values. The PR still needs some polishing but it is in a state where you can give it a run and get a feel for the new UX. Quick demoScreen.Recording.2023-05-18.at.5.23.20.pm.mp4
At this stage, that's how the style engine maps the values to CSS styles, which follows the approach the block supports took originally.
Good question. Long term, I'm expecting we will need to move to something like that. Updating the block supports and style engine to produce the correct styles with logical CSS properties should be pretty straightforward. Manipulating the control's UI to reflect the physical spacing might be a little more involved. I'd expect the style object to remain fairly consistent so with luck the trick would be applying appropriate labels and icons to the individual spacing sizes controls. This would be a great follow-up to explore so it can be stable before its need becomes more pressing. |
What problem does this address?
When padding / margin controls are unlinked (for per-side settings) they occupy an enormous amount of real estate. It's particularly bad when you unlink both. On my 16" MacBook they fill the entire Inspector 🙈 :
This feels especially bad when you only want to apply padding / margin to a single side which is not uncommon.
What is your proposed solution?
Use dynamic two-tone icons to let you select sides:
Issue updated Apr 13.
See initial proposal
I think we can optimise for single-side value application by allowing folks to choose where the padding / margin is applied in a popover menu containing the following options:
The custom option would effectively be the same as the current 'Unlink' option and provide a dedicated control for each sides. In this case I think we can condense by arranging the controls into columns.
Here's a visual which (hopefully) describes things a bit better:
As you can see the footprint of both single-side and unlinked control instances is significantly reduced.
The text was updated successfully, but these errors were encountered: