Skip to content
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

Improve the layout options for the footer component. #1726

Closed
1 task done
Tracked by #2274
maxgds opened this issue Feb 6, 2020 · 4 comments · Fixed by #2462
Closed
1 task done
Tracked by #2274

Improve the layout options for the footer component. #1726

maxgds opened this issue Feb 6, 2020 · 4 comments · Fixed by #2462

Comments

@maxgds
Copy link

maxgds commented Feb 6, 2020

What

Let the layout for the contents of a footer be more flexible to support more potential footer layouts.

Why

I'm currently trying to rebuild the GOV.UK website's existing footer using this component but the desired layout doesn't seem to be possible.

Further detail

The live site (http://www.gov.uk) looks like this:

Screenshot 2020-02-06 at 10 00 09

During different iterations of this footer the first section has contained a Brexit header with many list items in 2 columns, and as now, a Transition header with a single list item. In both cases this section should take up 2/3 of the space and line up with the next section, which also takes 2/3 of the space and is followed by a 3rd section taking the remainder of that pseudo-row. The problem is that using the footer component classes Section 1 and Section 2 don't align properly:

Screenshot 2020-02-06 at 10 01 21

This layout could be easily achieved using the design system layout classes, but it seems wrong to try to do that when the design system has implemented specific footer classes. Is there a reason why it is using flexbox instead of the custom classes?

Having sought feedback from design they are keen to keep the layout as-is in our design so we may be forced into using the non-footer approach.

Done when

  • "Details of breaking change" section below completed to help with writing release notes

Details of breaking change

  • which users are affected: TBC
  • the change that’s been made: TBC
  • changes users will have to make: TBC
  • impact of users not making those changes: TBC
@hannalaakso hannalaakso added the awaiting triage Needs triaging by team label Feb 6, 2020
@NickColley
Copy link
Contributor

NickColley commented Feb 6, 2020

We're aware of some other footer layout issues that we want to address so this is helpful.

The footer doesnt use the regular grid layout classes so that it flows better between breakpoints but I think this has made it more difficult to extend and use outside how we expected it to be used.

So I think when we address the other footer layout issues we'll want to consider taking a step away from flexbox and doing something simpler like you have suggested, perhaps exploring CSS Grid.

It would be nice to ensure that content in the footer columns have opportunity to determine how this component responds when on smaller screens but our priority is making sure it aligns with the overall grid so we'll keep this in mind.

I'm going to try and give you an example of a workaround you could consider in the meantime.

@NickColley NickColley added this to the v4.0.0 milestone Feb 6, 2020
@NickColley
Copy link
Contributor

One option is what you suggested is to use the grid classes:

<div class="govuk-width-container">
    <div class="govuk-grid-row govuk-!-margin-bottom-6">
        <div class="govuk-!-margin-bottom-6 govuk-grid-column-two-thirds-from-desktop">
            <!-- section stuff goes in here -->
        </div>
    </div>
    <div class="govuk-grid-row">
        <div class="govuk-!-margin-bottom-6 govuk-grid-column-two-thirds-from-desktop">
            <!-- section stuff goes in here -->
        </div>
        <div class="govuk-!-margin-bottom-6 govuk-grid-column-one-third-from-desktop">
            <!-- section stuff goes in here -->
        </div>
    </div>
</div>

@NickColley
Copy link
Contributor

Another alternative would be to add a 'dummy' empty section and ensure all last sections are a minimum width, this feels hacky:

@include govuk-media-query($from: desktop) {
  .govuk-footer__section:last-child {
    min-width: 33.3%;
  }
}

I've demonstrated that here: https://govuk-frontend-issue-1726.glitch.me/

@vanitabarrett
Copy link
Contributor

vanitabarrett commented Sep 8, 2021

As discussed in v4 prioritisation, we think this work is important but it's quite broad at the moment. We should probably do a timeboxed investigation into this issue and this related one to explore a few different layout systems for the footer and see how they perform.

We should keep in mind these other issues with the footer, some of which may be fixed by switching to a new layout system.

@lfdebrux lfdebrux self-assigned this Nov 9, 2021
vanitabarrett pushed a commit that referenced this issue Nov 29, 2021
This commit takes the example screenshot from this issue
#1726 - where it's reported
that it's not possible to build the layout given the alignment issues - and
adds a version of the footer to the full page example campaign page in the review
app so we have an example of this layout to test against.
vanitabarrett pushed a commit that referenced this issue Dec 1, 2021
This commit takes the example screenshot from this issue
#1726 - where it's reported
that it's not possible to build the layout given the alignment issues - and
adds a version of the footer to the full page example campaign page in the review
app so we have an example of this layout to test against.
vanitabarrett pushed a commit that referenced this issue Dec 1, 2021
This commit takes the example screenshot from this issue
#1726 - where it's reported
that it's not possible to build the layout given the alignment issues - and
adds a version of the footer to the full page example campaign page in the review
app so we have an example of this layout to test against.
@vanitabarrett vanitabarrett self-assigned this Dec 2, 2021
@vanitabarrett vanitabarrett linked a pull request Dec 2, 2021 that will close this issue
14 tasks
vanitabarrett pushed a commit that referenced this issue Dec 8, 2021
This commit updates the announcement example to fix the footer
layout to a two-thirds/one-third layout as it was before, using the
new `width` macro option.

This commit updates the campaign page example. It builds a footer based on
the example screenshot from #1726
vanitabarrett pushed a commit that referenced this issue Dec 8, 2021
This commit updates the announcement example to fix the footer
layout to a two-thirds/one-third layout as it was before, using the
new `width` macro option.

This commit updates the campaign page example. It builds a footer based on
the example screenshot from #1726
vanitabarrett pushed a commit that referenced this issue Dec 8, 2021
This commit updates the announcement example to fix the footer
layout to a two-thirds/one-third layout as it was before, using the
new `width` macro option.

This commit updates the campaign page example. It builds a footer based on
the example screenshot from #1726
vanitabarrett pushed a commit that referenced this issue Dec 8, 2021
This commit updates the announcement example to fix the footer
layout to a two-thirds/one-third layout as it was before, using the
new `width` macro option.

This commit updates the campaign page example. It builds a footer based on
the example screenshot from #1726
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment