-
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
Adds in viewports or adjusts them for block patterns #27204
Conversation
Size Change: -389 B (0%) Total Size: 1.2 MB
ℹ️ View Unchanged
|
This seems like a good improvement! Would it make sense to set a wider default viewport though? That way future blocks would benefit from this by default. |
@kjellr your comment took me on a journey into the code. I wasn't aware it wasn't set individually, so that's great information on block patterns. I have increased the default to 1200, which also means can reduce back a few lines, as they all use default value. |
@@ -7,7 +7,8 @@ | |||
|
|||
return array( | |||
'title' => __( 'Two columns of text with images', 'gutenberg' ), | |||
'categories' => array( 'columns' ), | |||
'categories' => array( 'columns' ), | |||
'viewportWidth' => 1200, |
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.
Can this one be taken out too?
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.
Left a single comment, but other than that this looks good to me! Thanks for looking into this.
Thanks for code review, caught that final one (so many lines we got to save here!). Once tests have passed I'll merge this little fix. Thanks @kjellr for collaborating on this. |
@ItsJonQ thank you so much it seems that the tests are all starting to pass now! |
Ideally when browsing block patterns you should see as close to what the pattern is going to be, if it's visually represented. Currently the following is what you see:
Problem
The main problem with this is that everything seems 'full width', even when it needs to be set. For example, headers, columns. This can also look a lot better with some spacing, to allow the content to breathe and be understood.
Solution
Props to @kjellr as I was exploring, for mentioning that this could be solved by setting 'viewportsWidth' on block patterns. In exploring I discovered some block patterns didn't have these set, others have very low settings. I have set in this PR some to 1200 along with giving some missing values, to bring a little uniformity.
After applying this PR here is what you should see:
Feedback
I would appreciate a code review and design feedback. This is a relatively small pickup PR, so be great to see about getting this in from there.