Skip to content

Commit 16e75d0

Browse files
committed
Much better mobile reflow of carousels...
* projects and collections reflow better regardless of the "per row" setting * slightly increase the usable width on smaller screens
1 parent 691d9c7 commit 16e75d0

8 files changed

+15
-13
lines changed

static/scss/snapcloud.scss

+6-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@
2323
// We often use 1/5 width items.
2424
// Bootstrap's grid system uses 12ths.
2525
// So we use col-20 for 20% width.
26-
.col-20 {
27-
flex: 0 0 auto;
28-
width: 20%;
29-
max-width: 20%;
26+
// TODO: This need to really be a SASS utility.
27+
@media screen and (min-width: 950px) {
28+
.col-lg-20 {
29+
flex: 0 0 auto;
30+
width: 20%;
31+
}
3032
}
3133

3234
[data-bs-theme=dark] {

static/style/compiled/snapcloud.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/style/compiled/snapcloud.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

views/carousel_bs.etlua

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ bootstrap_column_width = items_per_row == 5 and 20 or (12 / items_per_row)
1919
%>
2020

2121

22-
<div id="<%= id %>_container" class="<%= item_type %>s my-2 <%= class %>">
22+
<div id="<%= id %>_container" class="<%= item_type %>s my-2 container-fluid">
2323

2424
<% if ((num_pages > 0) or show_if_empty) then %>
2525
<div class="row">

views/index_bs.etlua

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ render(
106106
]]--
107107
%>
108108

109-
<div class="row projects">
109+
<div class="d-grid col-11 mx-auto">
110110
<a href="/collections" class="btn btn-lg btn-outline-primary"
111111
><%- locale.get('more_collections') %></a>
112112
</div>

views/layout_bs.etlua

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<% render('views.js.dialog') %>
88
<script>new customAlert();</script>
99
<% render('views.layout.navigation_bar_bs') %>
10-
<main class="container py-4">
10+
<main class="container-lg container-fluid mx-8 py-4">
1111
<% content_for('inner') %>
1212
</main>
1313
<% render('views.layout.footer_bs') %>

views/partials/collection_bs.etlua

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<% col_class = column_width and "col-" .. column_width or '' %>
2-
<div class="collection small <%- col_class %>">
1+
<% col_class = column_width and "col-lg-" .. column_width or '' %>
2+
<div class="collection small <%- col_class %> col-md-3 col-sm-4 col-xs-5">
33
<% if (item.thumbnail == nil) then %>
44
<i class="no-image fas fa-question-circle" aria-hidden=true></i>
55
<span class="sr-only">no thumbnail aet</span>

views/partials/project_bs.etlua

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<% col_class = column_width and "col-" .. column_width or '' %>
2-
<div class="project small <%- col_class %>">
1+
<% col_class = column_width and "col-lg-" .. column_width or '' %>
2+
<div class="project small <%= col_class %> col-md-3 col-sm-4 col-xs-5">
33
<% if (item.thumbnail == nil) then %>
44
<i class="no-image fas fa-question-circle"></i>
55
<span class="sr-only">no thumbnail aet</span>

0 commit comments

Comments
 (0)