Skip to content

Commit

Permalink
Fix main-content-container to work with govuk-frontend columns
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
matthillco committed Sep 16, 2024
1 parent cbbbf70 commit 1607329
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
11 changes: 1 addition & 10 deletions app/assets/stylesheets/views/_html-publication.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion app/views/content_items/html_publication.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
</div>
</div>

<div class="main-content-container<% unless @content_item.contents.any? %> offset-empty-contents-list<% end %>">
<div class="govuk-grid-column-three-quarters-from-desktop contents-container<% unless @content_item.contents.any? %> offset-empty-contents-list<% end %>">
<%= render "govuk_publishing_components/components/govspeak_html_publication", { direction: page_text_direction } do %>
<%= raw(@content_item.govspeak_body[:content]) %>
<% end %>
Expand Down

0 comments on commit 1607329

Please sign in to comment.