Skip to content

Commit

Permalink
Replace title component with heading
Browse files Browse the repository at this point in the history
- should still be a h1 and visually identical
- heading has no margin top, so matches the previous margin_top: 0 option on title
- title component is being retired and margin_top option has already been removed
  • Loading branch information
andysellick committed Jan 28, 2025
1 parent 88bbe2f commit f5c0769
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
1 change: 0 additions & 1 deletion app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ $govuk-page-width: 1140px;
@import 'govuk_publishing_components/components/summary-list';
@import 'govuk_publishing_components/components/table';
@import 'govuk_publishing_components/components/textarea';
@import 'govuk_publishing_components/components/title';
@import "tags";
@import "downtimes";
@import "options_sidebar";
Expand Down
7 changes: 4 additions & 3 deletions app/views/layouts/design_system.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@
<% if yield(:title).present? %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<%= render "govuk_publishing_components/components/title", {
title: yield(:title),
<%= render "govuk_publishing_components/components/heading", {
text: yield(:title),
context: yield(:title_context),
margin_top: 0,
margin_bottom: 6,
font_size: "xl",
heading_level: 1,
} %>
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions test/integration/edition_edit_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class EditionEditTest < IntegrationTest
end

should "show 'Metadata' header and an update button" do
within :css, ".gem-c-heading" do
within :css, ".gem-c-heading h2" do
assert page.has_text?("Metadata")
end
assert page.has_button?("Update")
Expand Down Expand Up @@ -139,7 +139,7 @@ class EditionEditTest < IntegrationTest
end

should "show 'Unpublish' header and 'Continue' button" do
within :css, ".gem-c-heading" do
within :css, ".gem-c-heading h2" do
assert page.has_text?("Unpublish")
end
assert page.has_button?("Continue")
Expand Down Expand Up @@ -215,7 +215,7 @@ class EditionEditTest < IntegrationTest
end

should "show 'Admin' header and not show 'Skip fact check' button" do
within :css, ".gem-c-heading" do
within :css, ".gem-c-heading h2" do
assert page.has_text?("Admin")
end
assert page.has_no_button?("Skip fact check")
Expand All @@ -235,7 +235,7 @@ class EditionEditTest < IntegrationTest
end

should "show 'Admin' header and not show 'Skip fact check' button" do
within :css, ".gem-c-heading" do
within :css, ".gem-c-heading h2" do
assert page.has_text?("Admin")
end
assert page.has_no_button?("Skip fact check")
Expand All @@ -262,7 +262,7 @@ class EditionEditTest < IntegrationTest
end

should "show 'Admin' header and an 'Skip fact check' button" do
within :css, ".gem-c-heading" do
within :css, ".gem-c-heading h2" do
assert page.has_text?("Admin")
end
assert page.has_button?("Skip fact check")
Expand Down

0 comments on commit f5c0769

Please sign in to comment.