-
Notifications
You must be signed in to change notification settings - Fork 799
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
Tiled gallery: gutter #14705
Tiled gallery: gutter #14705
Conversation
Caution: This PR has changes that must be merged to WordPress.com |
This is an automated check which relies on |
@iamtakashi since you've probably looked into quite a few block UIs like this, do you have thoughts on what would be good UI for changing the gutter setting? 🙂 |
@simison I think the common patterns that I've seen are either using a slider that gives you finer control or a dropdown that gives you presets like small, medium, etc. But I'd suspect it's hard to satisfy the user with the presets like that because those who care to change the gutter likely like to have finer control. What about a slider with 2px increments? |
@iamtakashi I agree slider would be the best — with the current technical implementation I just wanted to avoid creating too many allowed steps or otherwise the amount of CSS became crazy. I do like the aspect that we could adjust named gutter sizes be different on different screen sizes. "Large" gutter on mobile and desktop is a very different thing in pixels. CoBlocks allows setting exact pixel size separately for desktop and mobile but while it's a lot of control, I feel like that's just confusing to most. |
Responsive editing is being explored here: WordPress/gutenberg#19909. Until that's finalized, a single option for all the viewport should be fine?
I think 4px increment works as well. Would that also be too much CSS? |
Valid point — indeed better to stay away from creating custom UI for that stuff too early.
What would be the maximum cap? |
How about 60px? A nice rounding number of a multiple of 4. So the range will be 0px to 60px, and the default is 4px as it is currently. |
Haven't worked on this for a while but wanted to jot down some ideas. One idea could be to apply a gutter class to each image, or even applying it as inline style. Might perform best and offer better flexibility. It could even not be stored in html output but applied on the fly via JS when doing layout resize-calculations. |
CSS outputted via server-side as inline style would be effective but I really dislike making the block needlessly depend more on PHP. |
This PR has been marked as stale. This happened because:
No further action is needed. But it's worth checking if this PR has clear testing instructions, is it up to date with master, and it is still valid. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation. |
I'll close this PR for now because of the lack of activity on this. We can always reopen in the future if needed, but it will need a rebase, so it may be easier to start a new PR at this point. |
Add a gutter option to the Tiled gallery block.
Still little buggy and work in progress. Feel free to take PR over if you wanna help work on this!
Resolves #9548
Allows gutter options only as steps. The previous flexible solution I tried kinda would've exploded CSS bundle size.
Needs deciding styles for the gutter picker, two options I'm testing are select input and button group:
Latter gets little tricky with words translated sometimes longer in other languages:
Something compact like this could be an alternative but maybe less clear what those values are:
Changes proposed in this Pull Request:
Is this a new feature or does it add/remove features to an existing part of Jetpack?
Testing instructions: