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

Fix breadcrumbs WCAG problem in the covid page #3763

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions app/assets/stylesheets/views/_covid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,37 @@ $c19-landing-page-header-background: govuk-colour("blue");

.global-bar-present {
@include govuk-media-query($from: desktop) {
.covid__page-header {
.covid__breadcrumb-wrapper {
Copy link
Member

@hannalaakso hannalaakso Sep 10, 2024

Choose a reason for hiding this comment

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

Do we think that these three renamed classes are still being used? Their parent is something called .global-bar-present but there doesn't seem to be
.global-bar-present on the page or in the app.

Copy link
Contributor Author

@unoduetre unoduetre Sep 11, 2024

Choose a reason for hiding this comment

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

I didn't change anything just to stay safe, but I also don't think .global-bar-present is still used, so I'm happy to remove this part. It's also used in browse pages, so I can also remove it from there. Please, let me know, if that's ok?

Copy link
Member

@hannalaakso hannalaakso Sep 11, 2024

Choose a reason for hiding this comment

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

I dug into this and realised this for the global banner coming from static: https://docs.publishing.service.gov.uk/manual/global-banner.html#activate-the-global-banner It might be good to double check that these styles work if the global banner is there although I think it's been a bit waffy to test with the global banner in the past since it's in static 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll test it with a global banner enabled in static.

Copy link
Member

Choose a reason for hiding this comment

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

I've just had a look at integration/coronavirus and it looks good to me with the global banner enabled 👍 I'm going to approve the PR but let me know if there was something else about the global banner I should be checking.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's all I think.

border-top: solid govuk-spacing(2) $c19-landing-page-header-background;
}
}

@include govuk-media-query($until: desktop) {
.covid__page-header {
.covid__breadcrumb-wrapper {
margin-top: govuk-spacing(-3);
}
}

.covid_page_header {
.covid__breadcrumb-wrapper {
border-top: none;
}
}

.covid__breadcrumb-wrapper {
background-color: $c19-landing-page-header-background;
border-top: solid govuk-spacing(2) $covid-yellow;
overflow: auto; // become a block formatting context to prevent bleeding the margins
}

.covid__page-header {
margin-bottom: govuk-spacing(8);
background-color: $c19-landing-page-header-background;
border-top: solid govuk-spacing(2) $covid-yellow;
color: govuk-colour("white");
padding-top: govuk-spacing(1);

@include govuk-media-query($from: "tablet") {
padding-top: govuk-spacing(4);
}
}

.covid__page-header--business {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<% content_for :breadcrumbs do %>
<%= render 'coronavirus_landing_page/components/shared/breadcrumbs', {
breadcrumbs: breadcrumbs
} %>
<% end %>

<header class="covid__page-header covid__page-header--landing-page">
<div class="govuk-width-container">
<%= render 'govuk_publishing_components/components/breadcrumbs', {
breadcrumbs: breadcrumbs,
collapse_on_mobile: true,
inverse: true
} %>

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<%= render "govuk_publishing_components/components/title", {
title: raw(title),
inverse: true,
margin_top: 4
margin_top: 0
} %>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<div class="covid__breadcrumb-wrapper">
<div class="govuk-width-container">
<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<%= render 'govuk_publishing_components/components/breadcrumbs', {
breadcrumbs: breadcrumbs,
collapse_on_mobile: true,
inverse: true
} %>
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
corona_opengraph_images ||= false
%>
<% content_for :is_full_width_header, true %>
<% content_for :title, metadata[:title] %>
<% content_for :meta_tags do %>
<% page_url = File.join(request.base_url, request.path) %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<% content_for :body do %>
<%= yield :back_link %>
<% unless (content_for(:is_full_width_header) || content_for(:back_link)) %>
<% unless content_for(:back_link) %>
<% if content_for?(:breadcrumbs) %>
<%= yield :breadcrumbs %>
<% else %>
Expand Down