Skip to content

Commit 69064ac

Browse files
authored
fix themes cards heights (#17280)
* fix themes cards heights Signed-off-by: Faissal Wahabali <fwahabali@gmail.com> * crop Original screen image Signed-off-by: Faissal Wahabali <fwahabali@gmail.com> * crop themes card image using CSS Signed-off-by: Faissal Wahabali <fwahabali@gmail.com> * fix card different heights Signed-off-by: Faissal Wahabali <fwahabali@gmail.com> * refactor styling Signed-off-by: Faissal Wahabali <fwahabali@gmail.com> * refactor card image height Signed-off-by: Faissal Wahabali <fwahabali@gmail.com>
1 parent d77467b commit 69064ac

10 files changed

Lines changed: 43 additions & 2 deletions

File tree

templates/home/themes.twig

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
<div class="row row-cols-1 row-cols-md-2 row-cols-lg-3 row-cols-xl-4 g-4">
44
{% for theme in themes %}
55
<div class="col">
6-
<div class="card">
7-
<img src="./themes/{{ theme.id }}/screen.png" class="card-img-top" alt="{{ 'Screenshot of the %s theme.'|trans|format(theme.name) }}">
6+
<div class="card h-100 mt-0">
7+
<div class="card-img-container">
8+
<img src="./themes/{{ theme.id }}/screen.png" class="card-img-top h-100" alt="{{ 'Screenshot of the %s theme.'|trans|format(theme.name) }}">
9+
</div>
810
<div class="card-body">
911
<h5 class="card-title">{{ theme.name }} <small>({{ theme.version }})</small></h5>
1012
</div>

themes/bootstrap/scss/_card.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.card-img-container {
2+
height: $card-img-height;
3+
overflow: hidden;
4+
img {
5+
object-fit: cover;
6+
}
7+
}

themes/bootstrap/scss/_variables.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ $breadcrumb-navbar-padding-y: 0.5rem !default;
88
$breadcrumb-navbar-padding-x: 1.8rem !default;
99
$breadcrumb-navbar-margin-bottom: 0 !default;
1010
$breadcrumb-navbar-bg: #e9ecef !default; // $gray-200
11+
12+
// Card
13+
14+
$card-img-height: 16vh;

themes/bootstrap/scss/theme.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@
1212
@import "forms";
1313
@import "breadcrumb";
1414
@import "print";
15+
@import "card";

themes/metro/scss/_card.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
border-bottom: 0;
99
}
1010

11+
.card-img-container {
12+
height: $card-img-height;
13+
overflow: hidden;
14+
img {
15+
object-fit: cover;
16+
}
17+
}
18+
1119
.card-footer {
1220
border-top: 0;
1321
}

themes/metro/scss/_variables.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ $pagination-disabled-border-color: $border-color;
246246
$card-border-radius: 0;
247247
$card-cap-bg: $th-background;
248248
$card-bg: $th-background;
249+
$card-img-height: 16vh;
249250

250251
// Accordion
251252

themes/original/scss/_card.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@
1818
color: #444;
1919
}
2020

21+
.card-img-container {
22+
height: $card-img-height;
23+
overflow: hidden;
24+
img {
25+
object-fit: cover;
26+
}
27+
}
28+
2129
#maincontainer .card-header {
2230
position: static;
2331
width: auto;

themes/original/scss/_variables.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ $card-cap-bg: $th-background;
133133
$card-bg: $bg-one;
134134
$card-spacer-y: 0.5em;
135135
$card-spacer-x: 0.5em;
136+
$card-img-height: 16vh;
136137

137138
// Accordion
138139

themes/pmahomme/scss/_card.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@
3131
}
3232
}
3333

34+
.card-img-container {
35+
height: $card-img-height;
36+
overflow: hidden;
37+
img {
38+
object-fit: cover;
39+
}
40+
}
41+
3442
.card-footer {
3543
color: $th-color;
3644
background: $th-background;

themes/pmahomme/scss/_variables.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ $pagination-disabled-border-color: #aaa;
138138
$card-border-color: #aaa;
139139
$card-bg: #eee;
140140
$card-cap-bg: #fff;
141+
$card-img-height: 16vh;
141142

142143
// Accordion
143144

0 commit comments

Comments
 (0)