The responsive layout in Umami needs an improved and more consistent method for setting the left and right gutters. Currently the content edges do not align as well as they could across different breakpoints. Also, at smaller screen sizes the gutters could use being larger to avoid the content feeling quite so cramped to the viewport.
Proposed fix
The theme could use a consistent percentage-based left and right gutter applied to every outer wrapper that does not need to span edge-to-edge of the viewport. At the largest breakpoint size (1200px), this percentage gutter can give way to the existing max-width layout from .container (maximum width of 1200px center aligned to the viewport).
Ordinarily, we can apply this fix to region wrappers but may also need to be applied directly to some blocks, such as the promoted recipes on the front page, since the region is designed otherwise to span edge to edge of the viewport. There is current work happening on improving layout for Layout Builder support that will be able to support removal of these specific layout styles.
| Comment | File | Size | Author |
|---|---|---|---|
| #27 | interdiff.txt | 1 KB | lauriii |
| #27 | 3001660-27.patch | 18.5 KB | lauriii |
| #25 | interdiff-23-25.txt | 339 bytes | markconroy |
| #25 | 3001660-25.patch | 18.57 KB | markconroy |
| #25 | contact-form-2.png | 784.27 KB | markconroy |
Comments
Comment #2
tsega commented@kjay, I would love to help on this one; have you been able to review what the issues are?
Comment #4
kjay commentedComment #5
kjay commentedHere's a patch using 4% left and right gutters up to 1280px at which point the 1200px max-width container layout kicks in. Also see the attached screenshots showing this patch in action - nice and even layout across the screen sizes and better responsive side gutter sizing.
I've already started on improving the layout builder styles that will work with these changes. I'll post a comment here with the related issue update as soon as it's ready.
Comment #6
kjay commentedI should have added a note on the change in this patch to default image widths which used to have a max-width of 100%. In this patch I have switched to images defaulting to 100% width so that they stretch to fill their container. I think this is a helpful default for when we start thinking about how Layout Builder will get used with responsive column widths and images filling the layout they are placed into. In other words, it becomes the job of the layout container to limit the image width.
Comment #7
kjay commentedComment #9
kjay commentedThis patch was reviewed in yesterday's Out of the Box call and it was agreed that it is not desirable or necessary to apply changes to base image widths for the theme. Images will always be resized to fill the width of their container so long as they are physically wider than the container they are being displayed in.
New patch attached and has been worked on against 8.9.x. This patch removes the forced 100% width on images and removes the related alterations to the footer promo image.
Comment #10
kjay commentedThis patch was reviewed in a call yesterday along with @shaal and @markconroy using the Diffy tool to check for visual regressions and two issues were found:
Comment #13
kjay commentedReviewing with @shaal and @markconroy on reviewing patch and we found an issue with the two column layout on articles which requires not using the negative margin layout approach.
Comment #14
markconroy commentedMarking RTBC after 3 marathon reviews via Google Hangouts this week.
Great work @kjay and thanks for the help reviewing @shaal
Comment #15
shaalI ran diffy.website's visual regression test between latest Umami 8.8.x (that now includes media-images), and patch from comment #13 (which is patch 11)
This patch is fixing various padding/margin issues we had, breadcrumb positioning, the correct edge from the screen, and more.
I would re-RTBC it :)
To download the full comparison with various screen width (400MB)
https://diffy-files.s3.amazonaws.com/2019/11/05/Umami88x2019-11-5-187.ta...
Comment #16
lauriiiWhere can I test these?
Why do we need
.containerin this selector?.region-page-titleelement as well?Comment #17
shaal@kjay created this patch, I just helped cleaning a interdiff and uploading it here.
The interdiff is between patch11 and patch17 (this comment's patch), patch 11 was actually uploaded as part of comment #13
Comment #18
poojakural commentedThere is an inconsistency in left and right gutter. After apply apply patch the left and gutter space is consistent across pages. please refer the Screenshots.
Should we apply the 4% rule to the .region-page-title element as well? - As it is centre align to the page across the breakpoints . 4% will not required here.
//----
+.two-columns .main .layout-content,
+.two-columns .main .layout-sidebar {
...
.two-columns .main .layout-content {
...
+ .two-columns .main .layout-sidebar {
--///
you can test here - articles/give-it-a-go-and-grow-your-own-herbs
Comment #21
markconroy commentedThanks for that clean up @shaal
This patch is looking very good now.
@lauriii I'm going to mark this RTBC again if you are okay with committing it?
Comment #22
lauriiiI noticed few things that would be good to deal with before committing this:
There are some stylelint errors in the changes
I think the change causes regression on mobile width to articles that have comment form. See horizontal scroll on the screenshot.
Comment #23
markconroy commentedHi @lauriii
Thanks for that review. I'm attaching a new patch here with the stylelint fixes and also a change for what breakpoint we use the
display: flexfor two sidebars (as we currently have in ourlayout-2-col.css.Comment #24
markconroy commentedTested this for the forms on the site. Screenshots attached of our forms - Search and Login and Contact form
Search Form Before and After
Login Form Before and After
Contact Form Before and After
We can see there is a slight regression here because of a piece of padding that was added to the contact form wrapper in commit
ffb1e1e553in June 2019, for layout builder. I'll create a new patch to fix that.Comment #25
markconroy commentedPatch to remove the extra padding on the contact form wrapper.
Contact Form Currently and After Latest Patch
Comment #26
vulcanr commented#25 works as expected! Marking this as RTBC
Comment #27
lauriiiI ran
yarn run lint:css --fixto fix coding standard violations reported by CI for the patch in #25.Comment #30
lauriiiCommitted 0ce8821 and pushed to 9.2.x and 9.1.x. Thanks!
Comment #32
idebr commentedThis file does not exist. I have filed a follow-up to remove this file from umami.libraries.yml: #3199284: Umami includes non-existing css/components/regions/page-title/page-title.css