Browse Source

feat: update navbar styling

pull/3349/head
Nat Dean-Lewis 3 weeks ago
parent
commit
80f6c7ec42
  1. 10
      app/frontend/styles/_header.scss
  2. 12
      app/frontend/styles/application.scss
  3. 13
      app/helpers/application_helper.rb
  4. 3
      app/views/layouts/application.html.erb
  5. 3
      app/views/layouts/rails_admin/_navigation.html.erb

10
app/frontend/styles/_header.scss

@ -1,6 +1,4 @@
.app-header {
border-bottom: govuk-spacing(2) solid $govuk-brand-colour;
.govuk-header__logo {
@include govuk-media-query($from: desktop) {
width: 60%;
@ -22,11 +20,3 @@
}
}
.app-header--orange,
.app-header--orange .govuk-header__container {
border-bottom-color: govuk-colour("orange");
}
.app-header__no-border-bottom {
border-bottom: 0;
}

12
app/frontend/styles/application.scss

@ -130,3 +130,15 @@ $govuk-breakpoints: (
left: -15px;
position: relative;
}
.app-main-service-navigation {
border-bottom: govuk-spacing(2) solid $govuk-brand-colour;
}
.app-service-navigation--orange {
border-bottom-color: govuk-colour("orange");
}
.app-service-navigation--no-border {
border-bottom: 0;
}

13
app/helpers/application_helper.rb

@ -10,14 +10,11 @@ module ApplicationHelper
end
end
def govuk_header_classes(current_user)
if current_user&.support?
"app-header app-header--orange"
elsif notifications_to_display?
"app-header app-header__no-border-bottom"
else
"app-header"
end
def govuk_service_navigation_classes(current_user)
return "app-service-navigation--orange" if current_user&.support?
return "app-service-navigation--no-border" if notifications_to_display?
""
end
def govuk_phase_banner_tag(current_user)

3
app/views/layouts/application.html.erb

@ -81,13 +81,14 @@
<%= govuk_skip_link %>
<%= govuk_header(
classes: govuk_header_classes(current_user),
classes: "app-header",
homepage_url: root_path,
) %>
<%= govuk_service_navigation(
service_name: t("service_name"),
service_url: root_path,
classes: "app-main-service-navigation #{govuk_service_navigation_classes(current_user)}",
) do |component| %>
<% unless FeatureToggle.service_moved? || FeatureToggle.service_unavailable? %>
<% if current_user.nil? %>

3
app/views/layouts/rails_admin/_navigation.html.erb

@ -1,11 +1,12 @@
<%= govuk_header(
classes: "app-header app-header--orange",
classes: "app-header",
homepage_url: Rails.application.routes.url_helpers.root_path,
) %>
<%= govuk_service_navigation(
service_name: t("service_name"),
service_url: Rails.application.routes.url_helpers.root_path,
classes: "app-main-service-navigation app-service-navigation--orange",
) do |component| %>
<%= component.with_navigation_item(text: "Your account", href: Rails.application.routes.url_helpers.account_path) %>
<%= component.with_navigation_item(text: "Sign out", href: Rails.application.routes.url_helpers.destroy_user_session_path) %>

Loading…
Cancel
Save