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

Add layouts that use the gem layout component #2411

Merged
merged 2 commits into from
Apr 14, 2021
Merged

Add layouts that use the gem layout component #2411

merged 2 commits into from
Apr 14, 2021

Conversation

injms
Copy link
Contributor

@injms injms commented Feb 9, 2021

What

Adds gem_layout and gem_layout_full_width as optional templates that can be requested by Slimmer. The plan is to swap the use of core_layout for gem_layout in each frontend app - and that both templates will be running side by side until this is complete.

Don't use this layout until the frontend app you're using has Slimmer v15.5.0 or later.

This can be viewed when running static locally at http://static.dev.gov.uk/templates/gem_layout.html.erb

Why

The current core_layout uses govuk_template, which is deprecated. govuk_template relies on govuk_frontend_toolkit for styles, which is also deprecated.

The gem_layout template uses the public layout component from the GOV.UK Publishing Components gem, which is maintained and regularly updated. The gem relies on the GOV.UK Design System, which is maintained and regularly updated.

Core layout contains styles that can interfere with components, for which hacks have to be written; for example focus link overrides and specific overrides in the cookie banner. These can be removed when the core_layout template stops being used.

Removing the use of govuk_template will mean that the compatibility mode ($govuk-compatibility-govuktemplate) can be turned off.

Because the gem_layout template only uses components which follow the component principles and component conventions there are no side effects - the styles and JavaScript won't affect anything outside of the components used in the template itself.

Appearance

Note - both the menu and the search appear at the same time. Inside each app Slimmer takes care of showing and hiding those parts of the header, so only one or none of those will appear.

On desktop / large screens:

image

and with emergency banner:

image

On mobile / smaller screens:
image

and with emergency banner:

image

@bevanloon bevanloon temporarily deployed to govuk-static-update-err-inlukx March 19, 2021 11:53 Inactive
@injms injms force-pushed the add-gem-layout branch 2 times, most recently from 39cbfd0 to 1d94589 Compare March 30, 2021 11:25
@injms injms marked this pull request as ready for review March 30, 2021 15:43
@injms injms changed the title 🚧 Add layouts that use the gem layout component Add layouts that use the gem layout component Mar 30, 2021
@injms injms requested review from chris-gds, maxgds and owenatgov March 31, 2021 11:31
@alex-ju alex-ju self-requested a review April 7, 2021 10:38
@injms injms force-pushed the add-gem-layout branch 2 times, most recently from 8e9f8bc to 75f1af7 Compare April 12, 2021 14:23
Copy link
Contributor

@alex-ju alex-ju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

app/views/root/gem_layout.html.erb Outdated Show resolved Hide resolved
@@ -48,7 +50,7 @@ Restarting the app should pick up the changes.
For example, to see changes made to static templates which
are wrapped around feedback pages, run `bowl feedback
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not-related to this change, but I'm not sure bowl is still a thing 😬

injms added 2 commits April 13, 2021 13:05
Uses the public layout component[1] to add a constrained width and a full width
layout template.

Dependent on Slimmer having compatibility added [2].

[1]: https://components.publishing.service.gov.uk/component-guide/layout_for_public
[2]: alphagov/slimmer#265
@injms injms requested a review from alex-ju April 13, 2021 12:07
Copy link
Contributor

@alex-ju alex-ju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above 🚢 was meant to be an approved review :shipit:

@injms injms merged commit 3062429 into master Apr 14, 2021
@injms injms deleted the add-gem-layout branch April 14, 2021 09:15
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.

3 participants