Skip to content

Commit d0e6457

Browse files
committed
Change organisations logo layout
- organisation logos on html publications are stacked, which wastes vertical and horizontal space as they only occupy around 1/4 of the page width on desktop - this change uses flexbox to arrange the logos in columns across the page, improving the use of space - for older browsers that don't support flexbox, the original layout is preserved
1 parent 00b2c8b commit d0e6457

File tree

5 files changed

+26
-13
lines changed

5 files changed

+26
-13
lines changed

app/assets/stylesheets/application.scss

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ $govuk-typography-use-rem: false;
1818
// helpers for common page elements
1919
@import 'helpers/sidebar-with-body';
2020
@import 'helpers/organisation-links';
21+
@import 'helpers/organisation-logos';
2122
@import 'helpers/parts';
2223
@import 'helpers/add-title-margin';
2324
@import "helpers/content-bottom-margin";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.organisation-logos {
2+
display: flex;
3+
flex-direction: row;
4+
flex-wrap: wrap;
5+
justify-content: flex-start;
6+
list-style-type: none;
7+
}
8+
9+
.organisation-logos__logo {
10+
padding-bottom: govuk-spacing(3);
11+
flex-basis: 25%;
12+
min-width: 130px;
13+
}
14+
15+
.organisation-logo__inner {
16+
max-width: 215px;
17+
padding-right: govuk-spacing(3);
18+
}

app/assets/stylesheets/views/_html-publication.scss

-8
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@
1010
margin-bottom: govuk-spacing(4);
1111
position: relative;
1212

13-
.organisation-logos {
14-
list-style-type: none;
15-
16-
.organisation-logo {
17-
padding-bottom: govuk-spacing(2);
18-
}
19-
}
20-
2113
// design calls for the logos at the top to always be left aligned
2214
.direction-rtl & {
2315
direction: ltr;

app/views/content_items/html_publication.html.erb

+6-4
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@
99
%>
1010

1111
<% if @content_item.organisations %>
12-
<div class="govuk-grid-row publication-external">
13-
<ol class="govuk-grid-column-one-quarter organisation-logos">
12+
<div class="publication-external">
13+
<ol class="organisation-logos">
1414
<% @content_item.organisations.each do |organisation| %>
1515
<% logo_attributes = @content_item.organisation_logo(organisation) %>
1616
<% next unless logo_attributes %>
17-
<li class="organisation-logo">
18-
<%= render 'govuk_publishing_components/components/organisation_logo', logo_attributes %>
17+
<li class="organisation-logos__logo">
18+
<div class="organisation-logo__inner">
19+
<%= render 'govuk_publishing_components/components/organisation_logo', logo_attributes %>
20+
</div>
1921
</li>
2022
<% end %>
2123
</ol>

test/integration/html_publication_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class HtmlPublicationTest < ActionDispatch::IntegrationTest
7474
end
7575

7676
def assert_has_component_organisation_logo_with_brand(brand, index = 1)
77-
within("li.organisation-logo:nth-of-type(#{index})") do
77+
within("li.organisation-logos__logo:nth-of-type(#{index})") do
7878
assert page.has_css?(".gem-c-organisation-logo.brand--#{brand}")
7979
end
8080
end

0 commit comments

Comments
 (0)