Skip to content

Commit

Permalink
Divide country list into columns
Browse files Browse the repository at this point in the history
  • Loading branch information
vinc committed Aug 26, 2023
1 parent 59b63a6 commit 9256ad5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions app/assets/stylesheets/application.bootstrap.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,15 @@ $link-hover-decoration: underline;
.container {
max-width: 45rem;
}

ul.columns {
column-count: 1;

@include media-breakpoint-up(sm) {
column-count: 2;
}

@include media-breakpoint-up(lg) {
column-count: 3;
}
}
2 changes: 1 addition & 1 deletion app/views/electricity/emissions/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</p>
<% else %>
<h3>Electricity emissions</h3>
<ul>
<ul class="columns">
<% @countries.each do |country| %>
<li><%= link_to country.name, "/electricity/emissions/#{country.code}" %></li>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/electricity/generation/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</p>
<% else %>
<h3>Electricity generation</h3>
<ul>
<ul class="columns">
<% @countries.each do |country| %>
<li><%= link_to country.name, "/electricity/generation/#{country.code}" %></li>
<% end %>
Expand Down

0 comments on commit 9256ad5

Please sign in to comment.