-
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
Revisit the bundled block patterns #29973
Revisit the bundled block patterns #29973
Conversation
lib/block-patterns.php
Outdated
); | ||
} | ||
|
||
register_block_pattern_category( 'nature', array( 'label' => _x( 'Nature', 'Block pattern category' ) ) ); |
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.
I think the categories should be a bit more functional: text, columns, galleries, hero / cover, etc. Can we revise them?
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.
Agreed — I've left some category recommendations below.
I'm sharing some feedback (and suggested categories) for each of the patterns below. I need to do another round of testing these on mobile to see how they scale down on mobile, so stay tuned for that. I also noticed that this new set doesn't include any replacements for the "Buttons" patterns that are currently bundled with core. I think it makes sense to keep those around, so either myself, @beafialho, or @melchoyce will share a couple updated button-only patterns in this thread later today.
|
Here's an additional buttons-only pattern from @beafialho that we can include. Title: Two Buttons |
I checked the responsive behavior of these, and there are a ton of issues with the ones that use larger text. For themes that don't have wide content widths (Like Twenty Fifteen for example), this is a problem all the time, not just on smaller screens. I don't think we'll be able to get those working as designed unless we have a fluid font-size option available, as per #23323 or #24480. We could technically make the font size smaller for these, but it's going to negatively effect the design. 😞 I'm interested in other designers' thoughts on this. Screenshots |
Let's try to add variable font-size and see if that works. I'm interested in a solution that makes things work well by default without a lot of tweaks at every breakpoint. |
If Gutenberg added the option of using |
Aren't custom units something a theme opts in? I'm not aware of the context of the decision to not add them globally for every theme. If we add them for font sizes, should we do that in the same way? In that case, that won't be universal and not all themes will be able to benefit from them. |
I think that got implemented globally... I know that for example, the Custom Units control in the cover block height field works even if the theme hasn't opted in. But even if that's not the case, I'd expect that if we used custom units in a block pattern, they'd work even if the theme didn't specifically opt in. That's the way it works with line height: If a pattern uses custom line height, it respects that setting even if the theme hasn't opted in. |
Agreed. Also cc @nosolosw as it seems related to the supports decoupling. |
👋 took a look at this, and it seems to be that there are two things here:
210322-1848-font-size-vw-units.mp4
|
I've been investigating this myself but I'm afraid I am missing a lot of context on how components work (I was trying to implement the UnitSelect component inside Font Size control but that didn't seem to be the way to go about it). I'm very interested in this and I'd love to pair with anyone that wants to have a look at this. |
I guess I just never expected that to work. 😂 Thanks for the tip. I'll give this PR a quick refresh later today/tomorrow to try and get that working. |
Cool, let's get the patterns updated to use them just so that we can merge them then :) |
I've adjusted the font sizes on the larger-text patterns so that they all use
(I fixed that line break in the "Overseas..." pattern right after I took the screenshot) @melchoyce if you have a moment, do you think you can help test this and see if those text sizes are working ok in other themes as well? Once these changes and the new button pattern are included in this PR, I think it'll be in pretty good shape. |
I just updated with the renames and the missing buttons block pattern:
|
In other words, the control has to look and work differently. (Poke at this example to get a sense for the current design) Design: Limited Space (Reset Button)The presence of the "Reset" button makes it very difficult to include a unit control (due to spacing constraints). IMO, the "Reset" mechanic as a whole needs to be updated - something touched upon in the updated Sidebar/controls post. P.S. Limited Interaction: Changing valuesThis one is a minor one. The current
That way, the At the moment, there are quite a few E2E tests that rely on the current interaction. This was something we encountered during the initial integration attempts. Moving forwardIMO, to successfully add unit support to the UI control, we need to address the UI + interaction concerns above ☝️ Hope this context was helpful! |
Yes, to expose these in the UI we need to redo the typography panel with the new design direction, accounting for all the interrelations of the typographic settings |
I'll get started on a core issue like this one so that we can try getting the images uploaded to the WordPress.org CDN. Once those are up, we can swap out the links here (and in WordPress/wordpress-develop#1103) with those final ones. In the meantime, a few small notes:
Thanks! |
Just tested with all the Twenties. I added each pattern into a post, to see how the patterns would hold up when potentially next to a sidebar. Short answer: not well. Font sizing is an issue for these themes on desktop: These issues appear in Twenty Eleven, Twelve, Thirteen, Fourteen, Fifteen, Sixteen, and Seventeen. Here's a gallery of all the Twenties: https://cloudup.com/cnLGtBQKuqc |
But it also looks like, three columns of text just don't work in general for some themes. The very-short line lengths are problematic even for the smaller text here: I'm not totally sure how to solve for that sort of thing. In general, patterns aren't always going to work nicely for all themes. But maybe we need to be more conservative about that for the default patterns? |
I think that's a decent compromise. I'll write up alt tags for the ones missing 👍 |
|
Co-authored-by: Kjell Reigstad <[email protected]>
b53b730
to
1cb8196
Compare
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.
This is looking great. Tests are passing, so let's get this in and get a broader set of users testing them! 🎉
Description
This PR adds the block patterns discussed in #28921
How has this been tested?
These have been tested using Empty Theme
Screenshots
Nature
Art
Architecture
Types of changes
New feature
Checklist: