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

Update footer to use CSS grid instead of flexbox #2423

Closed
wants to merge 3 commits into from

Conversation

lfdebrux
Copy link
Member

@lfdebrux lfdebrux commented Nov 8, 2021

This PR resurrects a spike by @NickColley in 2019 and rebases it on top of our code today.

I've done a little testing and I think it fixes issues #1539 and #1729 (with the addition of a span parameter).

I'm opening this draft PR now as I'd like to pair with another dev to explore it further and find any pitfalls early.

Breaking change, moves column modifier to section so that the columns
influence how far the overall section spans in the grid.
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2423 November 8, 2021 11:26 Inactive
@lfdebrux
Copy link
Member Author

lfdebrux commented Nov 8, 2021

Screenshot of some previous GOV.UK footer layouts with the new CSS, based on comments from #1729

Screenshot 2021-11-08 at 11 04 52

Screenshot 2021-11-08 at 11 06 51

I think the screenshots show that the alignment issues preventing Max from using the design system footer for GOV.UK are fixed by using CSS grids.

@lfdebrux
Copy link
Member Author

lfdebrux commented Nov 8, 2021

One of the immediate disadvantages of using CSS grids is the same CSS won't work with IE11: this screenshot of the code in d0b4bd6 in IE11 shows that the footer sections are all bunched up to the left and mis-aligned. It might be possible however to add some IE11 specific CSS that uses the version of grid that IE11 does support, but it won't look perfect in IE8 or 9.

Screenshot 2021-11-08 at 11 32 48

@lfdebrux
Copy link
Member Author

lfdebrux commented Nov 8, 2021

It looks like support for a grid-based footer in IE11 is going to be severely constrained by the fact that Internet Explorer doesn't support auto-placement:

The main thing to know right now is that if you want to use CSS grid in an IE-friendly way, you should only ever use it if there are a known number of cells for a known number of rows and columns.

So we'd probably need totally different CSS for IE if we wanted to get the alignment right.

@lfdebrux lfdebrux force-pushed the nickcolley-ldeb-spike-footer-grid branch from 9bf8b87 to b3ece26 Compare November 8, 2021 16:23
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2423 November 8, 2021 16:23 Inactive
Allow having a footer section that spans multiple columns but does not
have multiple columns of list items. Useful if you have multiple rows of
sections and want to align a section with only a few items with a
section with many items (for instance the current GOV.UK footer layout).
@lfdebrux lfdebrux force-pushed the nickcolley-ldeb-spike-footer-grid branch from b3ece26 to b680d22 Compare November 10, 2021 11:15
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2423 November 10, 2021 11:16 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants