-
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
Add fullScreen
control to the block alignment toolbar
#16738
Add fullScreen
control to the block alignment toolbar
#16738
Conversation
I really like the concept, @retrofox! I believe adjusting a block to be full-screen-height could open up some amazing layout design. I am concerned about adding another toolbar section for this control. If we do ever decide to include I haven't looked at the code, but taking a look at how it functions in the Editor, I found a few areas needing refinement. I'm using the Gutenberg Starter Theme for testing which uses basic default Gutenberg styles in both the Editor and the frontend.
While you're working on this PR, I'd love to get more design feedback from others. |
Also congrats on your first PR!! 🎉 |
@mapk I tend to agree, this makes sense as part of the general alignments group, specially if we are looking at collapsing it always: #16557 However, this also has the advantage of being orthogonal to some of the wide alignments so you could make different interesting combinations. Perhaps we could split the alignment group within the dropdown (with a separator)? Not sure if that would increase or decrease its usability. |
I only turned the
I'd like listening to suggestions in this case since I'm not a designer which leads me to do implementations that only me understand :-D
Something to fix. 👍
yes, for instance, I like how the
Yup confirmed. Let me do another iteration. |
Good option imo. |
Hi @mapk!, I've creates a different approach to implement the I've added an animation but tbh it isn't enough to show the whole changes. It seems that's just a matter of testing deeply :-D |
I like the idea of stretching content to 100vh but am not sure about using background-size. Using the image element means we can take advantage of responsive images sizes, but background-size cover requires the largest image likely to be used, which is bad for small devices on slow connections. Could this use object-fit instead? There is a cover option available so images can still be scaled nicely. |
Definitely going to dig on this, @BinaryMoon. 👍 |
Really nice work. I would definitely echo Mark and Matías on this one — the only challenge with this one is how we show it in the toolbar. And an additional toolbar group feels like the wrong path for this. I understand that wide and fullwide are not traditional "alignments" thinking like how we're used to, but they have fit very nicely with left/center/right for exactly the reason you allude to: they do not stack. At the same time, in the same design, Bold and Italic buttons stack — those are just toggle buttons. For that reason, I think the option to explore is this one: #16738 (comment) Go with the dropdown, and put a separator into the dropdown. You could even have a subheading, like:
One of the reasons for the dropdown PR is to enable clearer labels and additional layout options like this. By adding a separator in that dropdown, we keep the "non-stackable" effect of the basic alignments, but allow additional on top of that. |
@retrofox, this is feeling really good. Let's implement Joen's suggestion above #16738 (comment). This probably involves rebasing with After that we can revisit the icon. |
e54da29
to
682d95b
Compare
3623d6a
to
ea0fc5d
Compare
5e9eb27
to
31ef94b
Compare
I've been updated the PR:
I've seen that some styles are already handled by the theme. I've added the root css rules in order to make it work as better as possible. How it works:It applies almost the same behavior to the |
Updated PR description |
Hey @retrofox, would you mind rebasing this PR? I'd like to see where it's at. Thanks! |
Going to update soon. It needs a deep rebase. |
Just a heads up alignments are being reworked these days. There are two links right above here to take a closer look at. |
Hey @retrofox |
closing in favor of #26615 |
Description
This PR adds a
fullScreen
control to the<BlockAlignmentToolbar />
component., trying to tackle the Full Screen alignment/display option on several blocks (#16385) issue.Related Issues:
How does it look
It adds the
fullScreen
control into the Alignment toolbar:How does it work
It applies almost the same behavior to the full mode does, but cut the height to the current height of the viewport.
wide
alignment (already done)It applies almost the same behavior to the full mode does, but cut the height to the current height of the viewport.
full
alignment (already done)wide
alignment (already done)fullScreen
alignmentHow has this been tested?
TBD
Pending Tasks
expand
control into the alignment toolbar.