Skip to content
This repository has been archived by the owner on Mar 6, 2023. It is now read-only.

Commit

Permalink
Remove Frontend Toolkit colour and spacing variables
Browse files Browse the repository at this point in the history
 - Some spacing and layout tweaks to ensure that these changes are visually consistent with previous version
  • Loading branch information
injms committed Sep 16, 2019
1 parent 83431b9 commit 45ef40e
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 54 deletions.
2 changes: 1 addition & 1 deletion app/assets/stylesheets/hacks/_header-tweaks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// this work, we need to slightly tweak the header's CSS from our app.
.header-title {
float: left;
color: $white;
color: govuk-colour("white");
@include bold-24;

// When the title appears on its own line (the search box is hidden and only a
Expand Down
16 changes: 8 additions & 8 deletions app/assets/stylesheets/mixins/_margins.scss
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
@mixin responsive-bottom-margin {
margin-bottom: $gutter-half;
margin-bottom: govuk-spacing(3);

@include media(tablet) {
margin-bottom: $gutter * 1.5;
margin-bottom: govuk-spacing(7);
}
}

@mixin responsive-top-margin {
margin-top: $gutter-half;
margin-top: govuk-spacing(3);

@include media(tablet) {
margin-top: $gutter * 1.5;
margin-top: govuk-spacing(7);
}
}

Expand All @@ -21,11 +21,11 @@


@mixin gutter-bottom-margin {
margin-bottom: $gutter;
margin-bottom: govuk-spacing(6);
}

@mixin gutter-top-margin {
margin-top: $gutter;
margin-top: govuk-spacing(6);
}

@mixin gutter-vertical-margins {
Expand All @@ -34,9 +34,9 @@
}

@mixin gutter-bottom-margin-to-double {
margin-bottom: $gutter;
margin-bottom: govuk-spacing(3);

@include media(tablet) {
margin-bottom: $gutter * 2;
margin-bottom: govuk-spacing(9);
}
}
12 changes: 6 additions & 6 deletions app/assets/stylesheets/modules/_collection.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.collection {
border-bottom: 1px solid $border-colour;
border-bottom: 1px solid $govuk-border-colour;

padding-bottom: $gutter-half;
margin-bottom: $gutter-half;
padding-bottom: govuk-spacing(3);
margin-bottom: govuk-spacing(3);

@include media(tablet) {
padding-bottom: $gutter;
margin-bottom: $gutter;
padding-bottom: govuk-spacing(6);
margin-bottom: govuk-spacing(6);
}

&:last-child {
Expand All @@ -22,7 +22,7 @@

&__description {
@include core-24;
color: $secondary-text-colour;
color: $govuk-secondary-text-colour;
margin-top: 0;
}

Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/modules/_govspeak-wrapper.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
.govuk-govspeak ul {
line-height: 1.45;
// govspeak margin bottom is 20px
margin-bottom: $gutter-half;
margin-bottom: govuk-spacing(3);
}

.govuk-govspeak h2 {
Expand Down
8 changes: 4 additions & 4 deletions app/assets/stylesheets/modules/_notice.scss
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
.notice {
clear: both;
@include responsive-bottom-margin;
padding: $gutter-half;
padding: govuk-spacing(3);

border: 5px solid $govuk-blue;
border: 5px solid $govuk-brand-colour;

@include media(tablet) {
padding: $gutter-two-thirds;
padding: govuk-spacing(4);
}

&__title {
@include bold-36;
margin-bottom: $gutter-one-third;
margin-bottom: govuk-spacing(2);
}

&__description {
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/modules/_related-content.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.related {
@include media(tablet) {
border-top: 1px solid $border-colour;
border-top: 1px solid $govuk-border-colour;
}
}

Expand Down
20 changes: 3 additions & 17 deletions app/presenters/topic_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ def visually_collapsed?
@visually_collapsed
end

def expanded?
def visually_expanded?
!visually_collapsed?
end

def display_as_accordion?
groups.count > 1 && visually_collapsed?
groups.count > 2 && visually_collapsed?
end

def accordion_content
Expand All @@ -51,20 +51,6 @@ def accordion_content
#
# This method returns the content in the required shape from the hash
# supplied by the `groups` method.
#
# The hash for each accordion section is required to have `name`,
# `description`, and `linked_items`. Minimal example:
# {
# name: 'Accordion section heading',
# description: 'Accordion section summary',
# linked_items: [
# {
# label: 'Link to example',
# href: 'http://example.com',
# }
# ],
# }


groups.map { |section|
{
Expand All @@ -77,7 +63,7 @@ def accordion_content
content: {
html: accordion_section_links(section.linked_items),
},
expanded: expanded?,
expanded: visually_expanded?,
}
}
end
Expand Down
22 changes: 11 additions & 11 deletions app/views/content_items/topic.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,33 @@

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<%= render "govuk_publishing_components/components/accordion", {
items: @content_item.accordion_content
} if @content_item.display_as_accordion? %>

<% unless @content_item.display_as_accordion? %>
<% @content_item.groups.each_with_index do |link_group, idx| %>
<% if @content_item.display_as_accordion? %>
<%= render "govuk_publishing_components/components/accordion", {
items: @content_item.accordion_content
} %>
<% else %>
<% @content_item.groups.each_with_index { |link_group| %>
<% if link_group.name.present? %>
<div class="subsection__header govuk-!-margin-bottom-3">
<h2 class="govuk-heading-m govuk-!-margin-bottom-1 subsection__title" id="<%= link_group.name.parameterize %>"><%= link_group.name %></h2>
<h2 class="govuk-heading-m govuk-!-margin-bottom-1 govuk-!-margin-top-3 subsection__title" id="<%= link_group.name.parameterize %>"><%= link_group.name %></h2>
<% if link_group.description.present? %>
<p class="govuk-body govuk-!-margin-bottom-1 subsection__description"><%= link_group.description %></p>
<% end %>
</div>
<% end %>
<ul class="govuk-list subsection__list govuk-!-margin-bottom-9">
<% link_group.linked_items.each do |linked_item| %>
<% link_group.linked_items.each { |linked_item| %>
<li class="subsection__list-item">
<%= link_to linked_item.label, linked_item.href, class: 'govuk-link' %>
</li>
<% end %>
<% } %>
</ul>
<% end %>
<% } %>
<% end %>
</div>

<div class="govuk-grid-column-one-third">
<aside class="related">
<aside class="related govuk-!-margin-top-3">
<% if @content_item.content_owners.any? %>
<div class="related-item govuk-!-padding-top-4 govuk-!-margin-bottom-5">
<h2 class="related-item__title govuk-heading-s govuk-!-margin-bottom-2" id="related-communities">
Expand Down
7 changes: 5 additions & 2 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
<html>
<head>
<title><%= yield :title %> - GOV.UK</title>
<% # TODO: revert this to include IE specific and print specific stylesheets %>
<%= stylesheet_link_tag "application" %>
<!--[if gt IE 8]><!--><%= stylesheet_link_tag "application" %><!--<![endif]-->
<!--[if IE 6]><%= stylesheet_link_tag "application-ie6" %><script>var ieVersion = 6;</script><![endif]-->
<!--[if IE 7]><%= stylesheet_link_tag "application-ie7" %><script>var ieVersion = 7;</script><![endif]-->
<!--[if IE 8]><%= stylesheet_link_tag "application-ie8" %><script>var ieVersion = 8;</script><![endif]-->
<%= stylesheet_link_tag "print", media: "print" %>

<%= javascript_include_tag "application" %>
<%= javascript_include_tag "start-modules" if Rails.env.test? %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/_change_history.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
<time datetime="<%= time.iso8601 %>" class="<%= time_class %>">
<%= l time, format: :short_ordinal %>
</time>
<p class="govuk-body-s app-c-change-history__change-note">
<p class="govuk-body-s app-c-change-history__change-note govuk-!-width-two-thirds">
<%= change.note %>
</p>
2 changes: 1 addition & 1 deletion app/views/shared/_custom_phase_message.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Complete our quick 5-question survey to <%= link_to "help us improve our content", survey_url, target: "_blank", rel: "noopener noreferrer" %>.
Complete our quick 5-question survey to <%= link_to "help us improve our content", survey_url, target: "_blank", rel: "noopener noreferrer", class: "govuk-link" %>.
2 changes: 1 addition & 1 deletion app/views/shared/_custom_phase_message_homepage.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Complete our quick 5-question survey to <%= link_to "help us improve our content", survey_url, target: "_blank", rel: "noopener noreferrer" %>.
Complete our quick 5-question survey to <%= link_to "help us improve our content", survey_url, target: "_blank", rel: "noopener noreferrer", class: "govuk-link" %>.

0 comments on commit 45ef40e

Please sign in to comment.