Skip to content

Commit

Permalink
Remove application.scss
Browse files Browse the repository at this point in the history
Remove unused _margins.scss and replace with responsive spacing override class
  • Loading branch information
jon-kirwan committed Mar 20, 2023
1 parent 478959a commit fc05b3c
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 43 deletions.
1 change: 0 additions & 1 deletion app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//= link_tree ../images
//= link application.js
//= link test-dependencies.js
//= link application.css

//= link components/_taxon-list.css
//= link components/_topic-list.css
Expand Down
10 changes: 1 addition & 9 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
$govuk-new-link-styles: true;

// This flag stops the font from being included in this application's
// stylesheet - the font is being served by Static across all of GOV.UK, so is
// not needed here.
$govuk-include-default-font-face: false;

@import "govuk_publishing_components/govuk_frontend_support";
@import "helpers/margins";
// Not used since AssetHelper is configured to load individual stylesheets
4 changes: 0 additions & 4 deletions app/assets/stylesheets/components/_topic-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,3 @@
@include govuk-font(16, $weight: bold);
}
}

.app-c-topic-list--margin-bottom {
@include responsive-bottom-margin;
}
24 changes: 0 additions & 24 deletions app/assets/stylesheets/helpers/_margins.scss

This file was deleted.

2 changes: 1 addition & 1 deletion app/views/components/_topic-list.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

ul_classes = %w[govuk-list app-c-topic-list]
ul_classes << "app-c-topic-list--small" if small
ul_classes << "app-c-topic-list--margin-bottom" if margin_bottom
ul_classes << "govuk-!-margin-bottom-6" if margin_bottom
ul_classes << brand_helper.brand_class if brand
%>
<% if items.any? %>
Expand Down
1 change: 0 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
<title><%= yield :title %> - GOV.UK</title>
<%= javascript_include_tag "test-dependencies" if Rails.env.test? %>
<%= javascript_include_tag "application" %>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= csrf_meta_tags %>
<%= yield :meta_tags %>
<%= render 'govuk_publishing_components/components/meta_tags', content_item: content_item_h %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/subtopics/_subtopic.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<% end %>
</div>

<div class="govuk-grid-column-one-third add-title-margin govuk-!-margin-bottom-3">
<div class="govuk-grid-column-one-third govuk-!-margin-top-8 govuk-!-margin-bottom-3">
<%= render "govuk_publishing_components/components/subscription_links", {
email_signup_link: "/email-signup?link=/topic/#{params[:topic_slug]}/#{params[:subtopic_slug]}",
email_signup_link_text: t("shared.get_emails"),
Expand Down
4 changes: 2 additions & 2 deletions spec/views/components/topic_list.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ def component_name
it "renders with margin-bottom" do
render_component(items: [simple_item])
# Margin bottom should not be applied by default
expect(rendered).not_to have_selector(".app-c-topic-list--margin-bottom")
expect(rendered).not_to have_selector(".govuk-\\!-margin-bottom-6")

render_component(items: [simple_item], margin_bottom: true)
expect(rendered).to have_selector(".app-c-topic-list--margin-bottom")
expect(rendered).to have_selector(".govuk-\\!-margin-bottom-6")
end
end

0 comments on commit fc05b3c

Please sign in to comment.