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 the header #557

Merged
merged 4 commits into from Oct 3, 2018
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,6 +1,10 @@
@import "helpers/govuk-frontend-settings";
@import "govuk-frontend/components/header/header";

.gem-c-layout-header--production .govuk-header__container {
border-bottom-color: govuk-colour("bright-red");
}

.gem-c-layout-header--integration .govuk-header__container,
.gem-c-layout-header--staging .govuk-header__container {
border-bottom-color: govuk-colour("yellow");
Expand All @@ -10,3 +14,36 @@
.gem-c-layout-header--test .govuk-header__container {
border-bottom-color: govuk-colour("grey-1");
}

.govuk-header__logo {
white-space: nowrap;
}

.govuk-header__product-name {
display: none;

@include govuk-media-query($from: tablet) {
display: inline-block;
}
}

.gem-c-environment-tag {
tijmenb marked this conversation as resolved.
Show resolved Hide resolved
tijmenb marked this conversation as resolved.
Show resolved Hide resolved
padding: 2px 5px 0;
margin-left: 3px;
vertical-align: middle;
@include govuk-font($size: 14, $weight: "bold");
}

.gem-c-environment-tag--production {
background-color: govuk-colour("bright-red");
}

.gem-c-environment-tag--development {
background-color: govuk-colour("grey-1");
}

.gem-c-environment-tag--staging,
.gem-c-environment-tag--integration {
background-color: govuk-colour("yellow");
color: govuk-colour("black");
}
@@ -1,5 +1,4 @@
<%
product_name ||= false
navigation_items ||= []
%>
<header class="gem-c-layout-header govuk-header gem-c-layout-header--<%= environment %>" role="banner" data-module="header">
Expand All @@ -18,12 +17,16 @@
GOV.UK
</span>
</span>
<% if product_name %>

<span class="govuk-header__product-name">
<%= product_name %>
Publishing
</span>

<span class="gem-c-environment-tag govuk-tag gem-c-environment-tag--<%= environment %>">
<%= environment %>
</span>
<% end %>
</a>

</div><div class="govuk-header__content">

<% if navigation_items.any? %>
Expand Down
Expand Up @@ -19,10 +19,6 @@ examples:
development_environment:
data:
environment: development
with_product_name:
data:
environment: production
product_name: Product
with_navigation:
data:
environment: production
Expand Down
6 changes: 0 additions & 6 deletions spec/components/layout_header_spec.rb
Expand Up @@ -17,12 +17,6 @@ def component_name
assert_select ".govuk-header.gem-c-layout-header--staging"
end

it "renders the product name" do
render_component(environment: "staging", product_name: "Product name")

assert_select ".govuk-header__product-name", text: "Product name"
end

it "renders the header with navigation items" do
navigation_items = [
{ text: "Foo", href: "/foo", active: true },
Expand Down
3 changes: 1 addition & 2 deletions spec/dummy/app/views/layouts/dummy_admin_layout.html.erb
@@ -1,4 +1,4 @@
<% environment = "production" %>
<% environment = %w[development production staging integration].sample %>

<%= render 'govuk_publishing_components/components/layout_for_admin', {
environment: environment,
Expand All @@ -7,7 +7,6 @@
<%= render "govuk_publishing_components/components/skip_link" %>
<%= render "govuk_publishing_components/components/layout_header", {
environment: environment,
product_name: "Admin",
navigation_items: [
{text: "John Doe", href: "#profile"},
{text: "Log out", href: "#logout"}
Expand Down