Skip to content

Commit

Permalink
Use new image card style for promotion slot
Browse files Browse the repository at this point in the history
On homepage, use the new image card layout.
  • Loading branch information
patrickpatrickpatrick committed Sep 18, 2023
1 parent 31ff181 commit 79d40c9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
13 changes: 13 additions & 0 deletions app/assets/stylesheets/views/_homepage_new.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@
}
}

.homepage__services-and-information {
@include govuk-media-query($from: desktop) {
width: 55%;
}
}

.homepage__promotion-slots {
@include govuk-media-query($from: desktop) {
width: 45%;
padding-left: 0;
}
}

.homepage-inverse-header__title {
@include govuk-typography-weight-bold;
color: govuk-colour("white");
Expand Down
6 changes: 3 additions & 3 deletions app/views/homepage/new/_body.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-full govuk-grid-column-two-thirds-from-desktop">
<div class="govuk-grid-column-full homepage__services-and-information">
<%= render "homepage/services_and_information" %>
</div>
<div class="govuk-grid-column-full govuk-grid-column-one-third-from-desktop">
<div class="govuk-grid-column-full homepage__promotion-slots">
<%= render "homepage/new/promotion-slots" %>
</div>
</div>
<%= render "homepage/new/government_activity" %>
<%= render "homepage/government_activity" %>
<%= render "homepage/more_on_govuk" %>
3 changes: 2 additions & 1 deletion app/views/homepage/new/_promotion-slots.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@
image_loading: "lazy",
heading_level: 3,
heading_text: item[:title],
two_thirds: true,
description: item[:text],
font_size: "s",
sizes: "(max-width: 640px) 100vw, (max-width: 1020px) 33vw, 300px",
srcset: item.fetch(:srcset, {}).stringify_keys.transform_keys { |k| image_path(k) }.presence
} %>
<% end %>
</section>
</section>

0 comments on commit 79d40c9

Please sign in to comment.