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.

CommentFileSizeAuthor
#27 interdiff.txt1 KBlauriii
#27 3001660-27.patch18.5 KBlauriii
#25 interdiff-23-25.txt339 bytesmarkconroy
#25 3001660-25.patch18.57 KBmarkconroy
#25 contact-form-2.png784.27 KBmarkconroy
#24 contact-form.png923.69 KBmarkconroy
#24 login-form.png705.08 KBmarkconroy
#24 search-form.png627.33 KBmarkconroy
#23 interdiff-17-23.txt3.51 KBmarkconroy
#23 3001660-23.patch18.08 KBmarkconroy
#22 Screenshot 2020-12-11 at 16.31.15.png57.66 KBlauriii
#18 Screenshot 2020-04-21 at 1.23.48 PM.png1.39 MBpoojakural
#18 Screenshot 2020-04-21 at 1.22.47 PM.png1.31 MBpoojakural
#18 Screenshot 2020-04-21 at 1.22.37 PM.png1.37 MBpoojakural
#17 interdiff_11-17.txt1.7 KBshaal
#17 demo_umami-responsive_layout-3001660-17.patch18.12 KBshaal
#13 interdiff-10-11.txt757 byteskjay
#13 demo_umami-responsive_layout-3001660-11.patch17.39 KBkjay
#10 interdiff-9.10.txt1.83 KBkjay
#10 demo_umami-responsive_layout-3001660-10.patch17.32 KBkjay
#9 interdiff-5-9.txt859 byteskjay
#9 demo_umami-responsive_layout-3001660-9.patch16.97 KBkjay
#5 Screenshot_1400px Vegan chocolate and nut brownies Umami Food Magazine(3).png1.26 MBkjay
#5 Screenshot_1400px Skip the spirits with delicious mocktails Umami Food Magazine(2).png1.69 MBkjay
#5 Screenshot_1400px Home Umami Food Magazine(3).jpg1.16 MBkjay
#5 Screenshot_1200px Skip the spirits with delicious mocktails Umami Food Magazine(1).png1.5 MBkjay
#5 Screenshot_1200px Home Umami Food Magazine(2).jpg1 MBkjay
#5 Screenshot_960px Vegan chocolate and nut brownies Umami Food Magazine(2).png1.19 MBkjay
#5 Screenshot_960px Skip the spirits with delicious mocktails Umami Food Magazine.png1.11 MBkjay
#5 Screenshot_960px Articles Umami Food Magazine(2).png1.02 MBkjay
#5 Screenshot_960px Home Umami Food Magazine(1).jpg806.82 KBkjay
#5 Screenshot_760px Vegan chocolate and nut brownies Umami Food Magazine(1).png940.76 KBkjay
#5 Screenshot_760px Skip the spirits with delicious mocktails Umami Food Magazine.jpg1.17 MBkjay
#5 Screenshot_760px Articles Umami Food Magazine(1).png1.48 MBkjay
#5 Screenshot_720px Home Umami Food Magazine.jpg817.51 KBkjay
#5 Screenshot_320px Vegan chocolate and nut brownies Umami Food Magazine.png358.17 KBkjay
#5 Screenshot_320px Give your oatmeal the ultimate makeover Umami Food Magazine.png770.28 KBkjay
#5 Screenshot_320px Articles Umami Food Magazine.png1.13 MBkjay
#5 Screenshot_320px Home Umami Food Magazine.png1.32 MBkjay
#5 demo_umami-responsive_layout-3001660-5.patch18.17 KBkjay
Skip_the_spirits_with_delicious_mocktails___Site-Install.png593.79 KBkjay

Comments

kjay created an issue. See original summary.

tsega’s picture

@kjay, I would love to help on this one; have you been able to review what the issues are?

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

kjay’s picture

Assigned: kjay » Unassigned
Issue summary: View changes
kjay’s picture

Here'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.

kjay’s picture

I 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.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

kjay’s picture

StatusFileSize
new16.97 KB
new859 bytes

This 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.

kjay’s picture

This 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:

  1. On Article pages, the layout of the sidebar lost its gutter in RTL. This patch switches the entire layout method for 2 columns (without layout builder) to using a negative margin on the wrapper and then applying a percentage-based margin to the left and right of all contained columns. This is the method being adopted in the related issue for layout builder changes in Umami: #3085534
  2. On the home page, the promoted content beneath the hero banner failed to have the correct CSS for setting up the 4% left/right margin at screen sizes below 1280px. The max-width of 1200px was also not set. This patch amends that.

kjay credited markconroy.

kjay credited shaal.

kjay’s picture

StatusFileSize
new17.39 KB
new757 bytes

Reviewing 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.

markconroy’s picture

Status: Needs review » Reviewed & tested by the community

Marking RTBC after 3 marathon reviews via Google Hangouts this week.

Great work @kjay and thanks for the help reviewing @shaal

shaal’s picture

I 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...

lauriii’s picture

Status: Reviewed & tested by the community » Needs review
  1. +++ b/core/profiles/demo_umami/themes/umami/css/layout/layout-2-col.css
    @@ -2,23 +2,25 @@
    +.two-columns .main {
    ...
    +.two-columns .main .layout-content,
    +.two-columns .main .layout-sidebar {
    ...
       .two-columns .main .layout-content {
    ...
    +  .two-columns .main .layout-sidebar {
    

    Where can I test these?

  2. +++ b/core/profiles/demo_umami/themes/umami/css/layout/layout.css
    @@ -10,3 +10,13 @@
    +.main.container {
    ...
    +  .main.container {
    

    Why do we need .container in this selector?

  3. Should we apply the 4% rule to the .region-page-title element as well?
shaal’s picture

@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

poojakural’s picture

StatusFileSize
new1.37 MB
new1.31 MB
new1.39 MB

There 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

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

markconroy’s picture

Status: Needs review » Reviewed & tested by the community

Thanks 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?

lauriii’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs work
StatusFileSize
new57.66 KB

I noticed few things that would be good to deal with before committing this:

  1. # lauri.eskola @ MacBookPro-LauriEskola in ~/Projects/drupal/core on git:9.2.x x [16:30:38]
    $ yarn lint:css
    yarn run v1.22.10
    $ stylelint "**/*.css"
    
    profiles/demo_umami/themes/umami/css/layout/grid-2.css
      7:3  ✖  Expected "margin-right" to come before "margin-left"   order/properties-order
     13:1  ✖  Expected empty line before at-rule                     at-rule-empty-line-before
    
    profiles/demo_umami/themes/umami/css/layout/layout-2-col.css
     21:5  ✖  Expected "margin-right" to come before "margin-left"   order/properties-order
    
    profiles/demo_umami/themes/umami/css/layout/layout.css
     15:15  ✖  Expected a trailing semicolon   declaration-block-trailing-semicolon
    
    profiles/demo_umami/themes/umami/css/components/views/promoted-items.css
     113:3  ✖  Expected "margin" to come before "padding"     order/properties-order
     114:3  ✖  Expected "max-width" to come before "margin"   order/properties-order
    
    profiles/demo_umami/themes/umami/css/components/navigation/breadcrumbs/breadcrumbs.css
     15:5  ✖  Expected "padding-right" to come before "padding-left"   order/properties-order
    
    error Command failed with exit code 2.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    

    There are some stylelint errors in the changes


  2. I think the change causes regression on mobile width to articles that have comment form. See horizontal scroll on the screenshot.
markconroy’s picture

Status: Needs work » Needs review
StatusFileSize
new18.08 KB
new3.51 KB

Hi @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: flex for two sidebars (as we currently have in our layout-2-col.css.

markconroy’s picture

Status: Needs review » Needs work
StatusFileSize
new627.33 KB
new705.08 KB
new923.69 KB

Tested this for the forms on the site. Screenshots attached of our forms - Search and Login and Contact form

Search Form Before and After

Umami search form

Login Form Before and After

Umami login form

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 ffb1e1e553 in June 2019, for layout builder. I'll create a new patch to fix that.

Umami Contact Form

markconroy’s picture

Status: Needs work » Needs review
StatusFileSize
new784.27 KB
new18.57 KB
new339 bytes

Patch to remove the extra padding on the contact form wrapper.

Contact Form Currently and After Latest Patch

Umami contact form

vulcanr’s picture

Status: Needs review » Reviewed & tested by the community

#25 works as expected! Marking this as RTBC

lauriii’s picture

StatusFileSize
new18.5 KB
new1 KB

I ran yarn run lint:css --fix to fix coding standard violations reported by CI for the patch in #25.

  • lauriii committed 0ce8821 on 9.2.x
    Issue #3001660 by kjay, markconroy, lauriii, shaal, poojakural: Fix...

  • lauriii committed 3377672 on 9.1.x
    Issue #3001660 by kjay, markconroy, lauriii, shaal, poojakural: Fix...
lauriii’s picture

Version: 9.2.x-dev » 9.1.x-dev
Status: Reviewed & tested by the community » Fixed

Committed 0ce8821 and pushed to 9.2.x and 9.1.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

idebr’s picture

+++ b/core/profiles/demo_umami/themes/umami/umami.libraries.yml
@@ -39,7 +39,9 @@ global:
+      css/components/regions/page-title/page-title.css: {}

This 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