From 9019d3d8b45b3b97dbcd58fa0ad524b259a1492f Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Mon, 16 Sep 2024 12:37:15 +0100 Subject: [PATCH] Fix main-content-container to work with govuk-frontend columns This commit removes some of the rules that were previously set for the `.main-content-container` and instead uses the column rules from `govuk-frontend`. The container has now been renamed as `contents-container` to be consistent with the `contents-list-container`. I had hoped to remove this class entirely, but it's required to apply different float rules when in RTL reading mode. This also adds the new class for collapsing columns to full width when printing. --- app/assets/stylesheets/views/_html-publication.scss | 11 +---------- app/views/content_items/html_publication.html.erb | 4 ++-- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/app/assets/stylesheets/views/_html-publication.scss b/app/assets/stylesheets/views/_html-publication.scss index ef367ff35..aa5ca2b33 100644 --- a/app/assets/stylesheets/views/_html-publication.scss +++ b/app/assets/stylesheets/views/_html-publication.scss @@ -30,16 +30,7 @@ } } - .main-content-container { - width: 100%; - padding: 0 15px; - box-sizing: border-box; - - @include govuk-media-query($from: desktop) { - width: 75%; - float: right; - } - + .contents-container { .direction-rtl & { float: left; } diff --git a/app/views/content_items/html_publication.html.erb b/app/views/content_items/html_publication.html.erb index 4f804de9f..8f00d8886 100644 --- a/app/views/content_items/html_publication.html.erb +++ b/app/views/content_items/html_publication.html.erb @@ -46,7 +46,7 @@ <% end %>
-
+
<% if @content_item.contents.any? %>
<%= render 'govuk_publishing_components/components/contents_list', contents: @content_item.contents, format_numbers: true %> @@ -64,7 +64,7 @@
-
+
<%= render "govuk_publishing_components/components/govspeak_html_publication", { direction: page_text_direction } do %> <%= raw(@content_item.govspeak_body[:content]) %> <% end %>