Recommended commit message:

git commit -m 'Issue #2470233 by wadmiraal, emma.maria, sxnc, idebr, LewisNyman: Fix the visual bugs in the Bartik footer'

Many issues related to the footer were committed and each one seemed to introduce a visual bug. We need to fix all of them in this new issue.

Somewhere between beta7 and beta8 the footer layout and styles broke.

We also had this issue #1273052: Footer container contents are wider than other page elements in Bartik. which tried to improve the footer layout, but these styles were also lost.

Fixes to be added:

  1. All of the footer containers and styling (footer top, bottom and the dividing line) need to vertically sit inline with the rest of the region containers on the page.
  2. Also where did the blue link of a bigger size come from?

Screenshot pointing out bugs.

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Bug because the Footer visually looks broken at HEAD right now.
Issue priority Not critical because the footer still functions fine
Unfrozen changes Unfrozen because it only changes CSS and markup.
Prioritized changes The main goal of this issue is to fix visual regressions
Disruption No disruption.

CommentFileSizeAuthor
#49 2470233-47-after.png120.99 KBidebr
#47 drupal_bartik-footer_2470233_47.patch5.68 KBemma.maria
#47 interfiff-47-41.txt1.56 KBemma.maria
#44 2470233-41-after.png59.36 KBidebr
#41 drupal_bartik-footer_2470233_41.patch5.68 KBemma.maria
#41 interdiff-41-33.txt2.56 KBemma.maria
#41 Screen Shot 2015-06-16 at 18.21.23.png149.56 KBemma.maria
#41 Screen Shot 2015-06-16 at 18.07.16.png149.33 KBemma.maria
#41 Screen Shot 2015-06-16 at 18.20.30.png133.82 KBemma.maria
#41 Screen Shot 2015-06-16 at 18.19.48.png140.2 KBemma.maria
#40 footer-patch-36.png74.13 KBemma.maria
#40 footer-patch-33.png62.85 KBemma.maria
#40 footer-current-bugs.png214.07 KBemma.maria
#36 inter-diff-2470233-33-36.txt2.34 KBsxnc
#36 drupal_bartik-footer_2470233_36.patch4.85 KBsxnc
#33 drupal_bartik-footer_2470233_33.patch5.32 KBwadmiraal
#33 interdiff.txt1.12 KBwadmiraal
#33 bartik-rtl-wide.png143.19 KBwadmiraal
#31 bartik-rtl-wide.png141.13 KBwadmiraal
#31 bartik-rtl-medium.png137.04 KBwadmiraal
#31 bartik-rtl-narrow.png113.9 KBwadmiraal
#31 bartik-ltr-wide.png142.38 KBwadmiraal
#31 bartik-ltr-medium.png138.03 KBwadmiraal
#31 bartik-ltr-narrow.png87.22 KBwadmiraal
#31 interdiff.txt2.24 KBwadmiraal
#31 drupal_bartik-footer_2470233_31.patch5.16 KBwadmiraal
#25 footer-before-and-after.pdf2.96 MBemma.maria
#24 bartik-header-small.png53.29 KBwadmiraal
#24 bartik-header-medium.png71.2 KBwadmiraal
#24 bartik-header.png98.66 KBwadmiraal
#24 drupal_bartik-footer_2470233_24.patch3.77 KBwadmiraal
#24 interdiff.txt405 byteswadmiraal
#22 Screen Shot 2015-04-17 at 10.13.50.png217.43 KBemma.maria
#22 1360px-after-header-bug.png76.99 KBemma.maria
#22 1360px-after-footer.png343.43 KBemma.maria
#22 730px-after-footer.png287.45 KBemma.maria
#22 400px-after-footer.png518.6 KBemma.maria
#21 bartik-footer-tiny.png46.16 KBwadmiraal
#21 bartik-footer-small.png65.98 KBwadmiraal
#21 bartik-footer-full.png92.78 KBwadmiraal
#21 bartif-footer-middle.png87.34 KBwadmiraal
#20 interdiff.txt2.3 KBwadmiraal
#20 drupal_bartik-footer_2470233_20.patch3.38 KBwadmiraal
#17 Screen Shot 2015-04-15 at 13.57.00.png14.77 KBemma.maria
#15 bartik-footer-patch5.png87.55 KBwadmiraal
#15 bartik-footer-patch3.png86.4 KBwadmiraal
#13 bartik-footer-alignment_2.png169.55 KBwadmiraal
#13 bartik-footer-alignment.png170.69 KBwadmiraal
#10 bartik-footer-patch.png38.21 KBgoogletorp
#5 interdiff.txt476 byteswadmiraal
#5 drupal_bartik-footer_2470233_5.patch1.61 KBwadmiraal
#3 drupal_bartik-footer-link-color-size_2470233_3.patch1.14 KBwadmiraal
beta7->beta8.png13.49 KBemma.maria
beta8.png47.48 KBemma.maria
beta7.png30.88 KBemma.maria
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

emma.maria’s picture

Issue summary: View changes
wadmiraal’s picture

Assigned: Unassigned » wadmiraal

I'll have a look at it.

wadmiraal’s picture

Status: Active » Needs review
FileSize
1.14 KB

Fixed the size and color. The alignment will have to be looked at at this more recent issue: https://www.drupal.org/node/1273052

wadmiraal’s picture

Fixed the size and color. The alignment will have to be looked at at this more recent issue: https://www.drupal.org/node/1273052

wadmiraal’s picture

Oops, my bad. It is not related to the linked issue. Here's a new patch.

wadmiraal’s picture

Ok, sorry, I'm confused with all these issues :-). So, the alignment was actually "right" in beta8? As per: https://www.drupal.org/node/1273052#comment-9699005

If so, ignore the patch from #5, use #4.

emma.maria’s picture

Assigned: wadmiraal » Unassigned
googletorp’s picture

Status: Needs review » Reviewed & tested by the community

Tested patch from #3 and everything looks good.

emma.maria’s picture

Status: Reviewed & tested by the community » Needs review

Due to the issue being a fix for visual bugs we need to see some screenshots as part of the review before it can be set to RTBC.

googletorp’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
38.21 KB

As far as I can tell, it now looks exactly as before.

emma.maria’s picture

Status: Reviewed & tested by the community » Needs work

I'm sorry to be a pain but I can't tell from the screenshot if the edges of the footer region line up with in relation to the rest of the regions on the page. The footer should not be wider than the other regions on the page.

Also I can see from the screenshot that the footer top/bottom dividing line is wider than the footer content. We want the content and the line to start and end at the same points as shown in the before screenshot of Beta 7 in the summary.

Setting to needs work.

wadmiraal’s picture

Assigned: Unassigned » wadmiraal

On it.

wadmiraal’s picture

Assigned: wadmiraal » Unassigned
Issue summary: View changes
Status: Needs work » Needs review
FileSize
170.69 KB
169.55 KB

So, here's the status from #3:

Patch from #3

As you can see, it aligns to the left, but the padding from the main menu, the content and the footer, are not identical. How is the footer content supposed to be aligned anyway? Do we have some reference somewhere? Because from other issue queues, I get some contradicting info.

This is the status with patch #5:

Patch from #5

It is aligned to the left, with no padding. And the footer is slightly wider than the content.

googletorp’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
FileSize
93.13 KB

I had no idea reviewing visual bugs was this much of a hazzle.

Anyways, like I have been say, everything looks nice:

I've overlayed the font and placed the two side by side. As you can see they are pretty much identical. On the one site I had some content on the frontpage which makes stuff above the footer look a bit different, but the footer is exactly the same (beta 7 and the patch from #3)

wadmiraal’s picture

FileSize
170.69 KB
169.55 KB
86.4 KB
87.55 KB

Just without the visual overlays.

Patch #3:

Patch3

Patch #5:

Patch5

emma.maria’s picture

Assigned: Unassigned » emma.maria
Status: Reviewed & tested by the community » Needs review

Setting to Needs review as committers are active at Drupal Dev Days and as Bartik maintainer I need to take a closer look at this.

emma.maria’s picture

Assigned: emma.maria » Unassigned
Issue summary: View changes
Status: Needs review » Needs work
FileSize
14.77 KB

We are missing the improvements from this issue #1273052: Footer container contents are wider than other page elements in Bartik..

The footer needs to line up with the content section at all screen widths. The latest patch does not achieve this.

We need to take the patch in #5 where the line and content are flush at the beginning of the footer like so...
 

 
and engineer the footer so the width of the footer always visually lines up with the main content section. In other words the edge of the footer lines up with the actual content and not the edge of the padding on the content.

The issue with the site logo not lining up can be raised in a follow up issue.

I have spoken about this with @lewisnyman who can assist @wadmiraal with this patch if he would like to further take this work on :)

wadmiraal’s picture

Assigned: Unassigned » wadmiraal

Sure, I'll take it. It's pretty clear now :-).

Like I said: there are many issues, with diverging screenshots with comments "Looks fine to me". So, I have no idea how it's actually supposed to look. Also, if we have a reference somewhere (design, PSD, JPG, whatever), that would be helpful.

wadmiraal’s picture

The footer width bug was probably introduced when going for re-usable CSS classes, layout-container to be specific. The obvious fix would be to correct the footer layout-container's width:

/* Override container width. 30px narrower. */
.site-footer .layout-container {
  max-width: 830px;
}
@media all and (min-width: 851px) {
  .site-footer .layout-container {
    max-width: 1260px;
  }
}

However, this is fragile: if we decide to change the layout width, we need to remember to change it in 2 places.

A more robust, but also more verbose, solution would be to adapt the styling a little bit, by putting the top border on .region-footer-fifth instead of .site-footer__bottom. That way, we can add a 15px margin to the left and right of the region, and it will align nicely.

What do you think?

wadmiraal’s picture

Assigned: wadmiraal » Unassigned
Status: Needs work » Needs review
FileSize
3.38 KB
2.3 KB

This fixes the width at all breakpoints, as well as the 4 other footer regions, which didn't align properly.

wadmiraal’s picture

emma.maria’s picture

Issue summary: View changes
Status: Needs review » Needs work
FileSize
518.6 KB
287.45 KB
343.43 KB
76.99 KB
217.43 KB

The footer now looks beautiful at all widths.

@1360px

@730px

@400px

However a bug has been introduced to other places on the page.

The changes to the template shown below have caused visual regressions and markup changes to all menus printed. The if was being used to only allow a div wrapper with the class content to print around menus that do have labels. .content adds margin top I assume to provide spacing between the label and the menu.

This is seen clearly in the header...
 

 

 

+++ b/core/themes/bartik/templates/block--system-menu-block.html.twig
@@ -10,15 +10,12 @@
 {% set show_anchor = "show-" ~ attributes.id|clean_id %}
 {% set hide_anchor = "hide-" ~ attributes.id|clean_id %}
 {% block content %}
-  {# If a label is displayed, wrap it in <div class="content">. #}
-  {% if configuration.label_display %}
-    <div{{ content_attributes.addClass('content') }}>{{ content }}</div>
-  {% else %}
+  <div{{ content_attributes.addClass('content') }}>
     {# When rendering a menu without label, render a menu toggle. #}
     <div class="menu-toggle-target menu-toggle-target-show" id="{{ show_anchor }}"></div>
     <div class="menu-toggle-target" id="{{ hide_anchor }}"></div>
     <a class="menu-toggle" href="#{{ show_anchor }}">{{ 'Menu'|t }}</a>
     <a class="menu-toggle menu-toggle--hide" href="#{{ hide_anchor }}">{{ 'Menu'|t }}</a>
     {{ content }}
-  {% endif %}

We either need to come up with a better if condition or avoid using the .content wrapper in the footer.

wadmiraal’s picture

Assigned: Unassigned » wadmiraal

Ouch. Ok, I'll have a look at it :-)

wadmiraal’s picture

Assigned: wadmiraal » Unassigned
Status: Needs work » Needs review
FileSize
405 bytes
3.77 KB
98.66 KB
71.2 KB
53.29 KB

Actually, I think we should remove the margin on all .block .content elements in the header, not just the .header-region. We want all regions in the header to have as little effect on other elements as possible so as not to mess up the layout (contrary to the content area, which is a lot more lenient).

The header now looks normal (I think):

Header large

Medium

Small

emma.maria’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
2.96 MB
+++ b/core/themes/bartik/css/components/header.css
@@ -120,7 +120,7 @@ h1.site-name {
-.region-header .block .content {
+.header .block .content {
   margin: 0;
   padding: 0;
 }

I agree with this change. Bartik does not even print a .region-header wrapper currently at HEAD so these styles were doing nothing.

We are dealing with the issue of .content being too broad and affecting everything within #2398463: Clean up the "content" component in Bartik. Therefore having code to get around the issues with .content and focussing on getting the footer looking perfect again is OK by me.

I compared Bartik before and after the patch and there are now no visual regressions anywhere else on the page, only improvements to the footer which looks fantastic now.

Attached is a document containing the visual comparisons.

emma.maria’s picture

Issue tags: +drupaldevdays
emma.maria’s picture

Issue summary: View changes

Suggested commit message

git commit -m 'Issue #2470233 by wadmiraal, emma.maria: Fix the visual bugs in the Bartik footer'

emma.maria’s picture

Issue summary: View changes

Added beta evaluation.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/themes/bartik/css/components/site-footer.css
@@ -20,6 +25,12 @@
+  .site-footer__top .region:nth-child(2n+1) {
+    padding-right: 10px;
+  }
+  .site-footer__top .region:nth-child(2n) {
+    padding-left: 10px;
+  }

What about rtl?

wadmiraal’s picture

Assigned: Unassigned » wadmiraal

Ouch, there's a lot more wrong in the footer with RTL. I'll have a look at it.

wadmiraal’s picture

Assigned: wadmiraal » Unassigned
Status: Needs work » Needs review
FileSize
5.16 KB
2.24 KB
87.22 KB
138.03 KB
142.38 KB
113.9 KB
137.04 KB
141.13 KB

How's this?

wadmiraal’s picture

Assigned: Unassigned » wadmiraal
Status: Needs review » Needs work

Never mind, I just see now that RTL doesn't line up properly in full width.

wadmiraal’s picture

Assigned: wadmiraal » Unassigned
Status: Needs work » Needs review
FileSize
143.19 KB
1.12 KB
5.32 KB

Fixed the RTL footer at full width. Unfortunately, we need some pretty specific rule to get this to work...

Refer to #31 for screenshots at other resolutions.

LewisNyman’s picture

Status: Needs review » Needs work
+++ b/core/themes/bartik/css/components/site-footer.css
@@ -27,6 +46,34 @@
+  /**
+   * We need to be very specific for the padding for region-footer-second and
+   * region-footer-third, in order to suppress the padding cancellation rule in
+   * @media all and (min-width: 560px) {
+   *   [dir="rtl"] .site-footer__top .region:nth-child(2n+1) {}
+   *   [dir="rtl"] .site-footer__top .region:nth-child(2n) {}
+   * }.
+   */
+  [dir="rtl"] .site-footer__top .region.region-footer-second,
+  [dir="rtl"] .site-footer__top .region.region-footer-third {
+    padding: 10px;

Instead of having to override the selector, can we use a min-width/max-width media query so it doesn't apply to widths over 851px

sxnc’s picture

Assigned: Unassigned » sxnc

I'm working on this @DrupalCon LA

sxnc’s picture

Olright, here it goes, I moved some code around and moved part of the styling into the specific range of 560-850.

sxnc’s picture

Assigned: sxnc » Unassigned

Gonna leave the sprinting room soon, so I'll leave it by unassigning it :)

emma.maria’s picture

Status: Needs work » Needs review
idebr’s picture

Status: Needs review » Needs work
Issue tags: +Needs screenshots

@sxnc Thanks for working on this issue! I found a few issues with manual testing:

  1. +++ b/core/themes/bartik/css/components/site-footer.css
    @@ -5,11 +5,27 @@
    -  padding: 0 10px;
    +  padding: 0;
    

    .region has no padding, so this line has no effect.

  2. +++ b/core/themes/bartik/css/components/site-footer.css
    @@ -5,11 +5,27 @@
    +/* Temporary fix to align the footer. */
    +.site-footer .layout-container {
    +  padding: 0 15px;
    +}
    

    This line breaks the alignment of the site-footer__top with site-footer__bottom. Perhaps this should be site-footer__bottom .layout-container?

  3. +++ b/core/themes/bartik/css/layout.css
    @@ -10,6 +10,7 @@
    +  box-sizing: border-box;
    

    The box-sizing places the padding on the inside of the max-width. This results in footer blocks being places against the viewport for smaller viewports.

emma.maria’s picture

Issue summary: View changes
FileSize
214.07 KB
62.85 KB
74.13 KB

I have updated the issue summary to clearly point out what we are trying to achieve.

Unfortunately #36 has introduced a few visual regressions that didn't exist in #33...

Patch 33

Patch 36

emma.maria’s picture

I took a look at the patch and made some improvements to fix the regressions in #36 and to address the things raised by @idebr in #39 and @lewisnyman in #34.

Notably:

I moved the layout-container classes that were inconsistently applied directly to footer-top and then wrapped around footer-bottom. This has been moved to a div wrapper around both footer-top and footer-bottom and does not cause any visual issues. This also fixed point 2 raised by @idebr.

For the rest of #39:
1. This code no longer exists in the patch.
3. The box-sizing is not affecting the blocks at smaller viewports with this patch.

For #34:
I moved all of the styles specific to the "tablet 2 x 2 block view" of the four footer blocks to a min max media query so we don't have to undo anything in the layout at the next breakpoint up which was messy, as pointed out in #34.

I checked the patch visually LTR and RTL and everything lines up with the main content container at all viewports. So no nasty surpises for anyone reviewing this. The footer looks amazing now :)
 

 

 

 

 

Please can someone manually test and review at various screenwidths with a various number of blocks.

Status: Needs review » Needs work

The last submitted patch, 41: drupal_bartik-footer_2470233_41.patch, failed testing.

Status: Needs work » Needs review
idebr’s picture

Issue summary: View changes
Status: Needs review » Needs work
FileSize
59.36 KB

Thanks emma, this is looking very good!

  1. +++ b/core/themes/bartik/css/components/site-footer.css
    @@ -5,11 +5,16 @@
    -  padding: 35px 15px 30px;
    +  padding: 35px 0 30px;
    ...
    +/* Temporary fix to align the footer. */
    +.site-footer .layout-container {
    +  padding: 0 15px;
     }
    

    Now that .layout-container has moved up, this change is no longer necessary.

  2. +++ b/core/themes/bartik/css/components/site-footer.css
    @@ -5,11 +5,16 @@
     .site-footer .region {
       box-sizing: border-box;
    -  padding: 0 10px;
    +  padding: 0;
    

    .region has no padding, so this line does not do anything.

  3. +++ b/core/themes/bartik/css/components/site-footer.css
    @@ -27,9 +48,21 @@
     @media all and (min-width: 851px) {
    ...
    +  .site-footer__top .region:first-child {
    +    padding-left: 0; /* LTR */
    +  }
    ...
    +  .site-footer__top .region:last-child {
    +    padding-right: 0; /* LTR */
    +  }
    

    The blocks on the side are now wider than the two in the middle on 1290px+ viewport. Let's try and keep these the same width when possible.

    Screenshot of different block widths:

  4. +++ b/core/themes/bartik/css/components/site-footer.css
    @@ -27,9 +48,21 @@
       .site-footer__top .region {
    ...
    +    padding: 10px;
    

    The regions in the footer now have additional spacing at the top/bottom. The vertical padding is unnecessary as there is quite a bit of padding already.

  5. +++ b/core/themes/bartik/templates/page.html.twig
    @@ -168,19 +168,21 @@
    +        {% if page.footer_fifth %}
    +            <div class="site-footer__bottom">
    +              {{ page.footer_fifth }}
    +            </div>
    +        {% endif %}
    

    Nitpick: the .site-footer_bottom element has 4 spaces indent instead of 2 :)

LewisNyman’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: -Needs screenshots

I manually tested this patch and I can confirm it looks great.

emma.maria’s picture

Status: Reviewed & tested by the community » Needs work

:) I don't think @LewisNyman saw @idebr's comment. We need to fix the code issues, but nice to know the footer visually looks great.

emma.maria’s picture

Status: Needs work » Needs review
FileSize
1.56 KB
5.68 KB

Feedback for @idebr's feedback in #44

  1. The code is needed here, otherwise the site-footer container is wider than other regions on the page. It also follows the structure of other regions where we set the .layout-container class to get everything to the right width. I have removed the temporary comment.
  2.  

  3. Agreed, I have removed.
  4.  

  5. I moved the box-sizing: border-box; to only the 'tablet' breakpoint, the blocks will always have equal padding and width there. The widths were different with 4 blocks in a row as the box-sizing style was taking into account the first and last blocks not having padding on one side. I also changed the padding on the regions to be a % to work nicely with the width being a %. Now all of the blocks have the same width and match the width of HEAD right now.
  6.  

  7. As part of the work in Step 3, I have removed the unnecessary padding top and bottom on the regions with the new padding style. The bottom and top spacing now match HEAD also.
  8.  

  9. Thanks for spotting, fixed.

Status: Needs review » Needs work

The last submitted patch, 47: drupal_bartik-footer_2470233_47.patch, failed testing.

idebr’s picture

Issue summary: View changes
Status: Needs work » Reviewed & tested by the community
FileSize
120.99 KB

Excellent, thanks Emma! I did another manual test to confirm.

A screenshot for good measure:

Wim Leers’s picture

Just wanted to say: such awesome collaboration in this last bunch of comments! Kudos to @emma.maria, @LewisNyman and especially @idebr. :)

emma.maria’s picture

Issue summary: View changes

Thanks @Wim Leers.

Which reminds me I need to make sure I put everyone in a recommended commit message.

git commit -m 'Issue #2470233 by wadmiraal, emma.maria, sxnc, idebr, LewisNyman: Fix the visual bugs in the Bartik footer'

Thanks all!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

This issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed b84088e and pushed to 8.0.x. Thanks!

  • alexpott committed b84088e on 8.0.x
    Issue #2470233 by wadmiraal, emma.maria, sxnc, idebr, googletorp,...

Status: Fixed » Closed (fixed)

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