Просмотр исходного кода

:art: fixing up grid layout with actual grid | enforcing card height min

tags/0.9.0
J 4 лет назад
Родитель
Сommit
d6c1eaf562
3 измененных файлов: 8 добавлений и 7 удалений
  1. 2
    1
      vue-theme/src/components/card.vue
  2. 5
    5
      vue-theme/src/pages/list.vue
  3. 1
    1
      vue-theme/src/sss/variables.sss

+ 2
- 1
vue-theme/src/components/card.vue Просмотреть файл

@@ -41,6 +41,7 @@ export default {
41 41
 .card
42 42
     background-color: white
43 43
     padding: $ms--1
44
+    min-height: 305px
44 45
     overflow: hidden
45 46
     text-overflow: clip
46 47
     &--info 
@@ -52,7 +53,7 @@ export default {
52 53
         .featured-or-hero-image img
53 54
             object-fit: cover
54 55
             object-position: 0% 30%
55
-            max-height: calc($max-card-img-height / 2)
56
+            max-height: calc($max-card-img-height / 3)
56 57
             overflow-y: clip
57 58
     header a
58 59
         font-size: $ms--2

+ 5
- 5
vue-theme/src/pages/list.vue Просмотреть файл

@@ -243,16 +243,16 @@ export default {
243 243
     /* posts not grid list */
244 244
     .posts
245 245
         list-style: none
246
-        grid-gap: $ms-0
247 246
         .post
248 247
             width: 100%
249 248
     .posts.is-grid
250 249
         width: 100%
251
-        flex-direction: row
252
-        flex-wrap: wrap
253
-        justify-content: space-between
250
+        display: grid
251
+        grid-template-columns: 32% 32% 32%
252
+        align-items: start
253
+        /* This is important for how the grid lines up to the page */
254
+        justify-content: right 
254 255
         .post
255
-            width: unset
256 256
             img
257 257
                 max-width: 100%
258 258
 

+ 1
- 1
vue-theme/src/sss/variables.sss Просмотреть файл

@@ -12,7 +12,7 @@ $path: 4px
12 12
 /* Proportion */
13 13
 $base: 0.95em
14 14
 
15
-$max-card-img-height: 320px
15
+$max-card-img-height: 420px
16 16
 $card-line-clamp: 3
17 17
 
18 18
 $ratio: $minor-third

Загрузка…
Отмена
Сохранить