Selaa lähdekoodia

:art: checking conditional classes for list

tags/0.9.0
J 4 vuotta sitten
vanhempi
commit
c26e82b1e7

+ 17
- 9
vue-theme/src/components/card.vue Näytä tiedosto

6
         router-link(v-else-if="!hideType" :to="`/${type}`")
6
         router-link(v-else-if="!hideType" :to="`/${type}`")
7
             p.t-up {{type}}
7
             p.t-up {{type}}
8
 
8
 
9
-    article.card--info.f-col(:class="{ 'wide': wide }")
9
+    article.card--info(:class="{ 'wide': wide }")
10
         router-link(:to="`/${type}/${content.slug}`")
10
         router-link(:to="`/${type}/${content.slug}`")
11
             //- set image to thumbnail setting
11
             //- set image to thumbnail setting
12
             featured-image(:post="content", thumbsize="'standard'")
12
             featured-image(:post="content", thumbsize="'standard'")
43
     padding: $ms--1
43
     padding: $ms--1
44
     overflow: hidden
44
     overflow: hidden
45
     text-overflow: clip
45
     text-overflow: clip
46
-    &--info
46
+    &--info 
47
+        display: flex
48
+        flex-direction: column
47
         > a
49
         > a
48
             line-height: 0
50
             line-height: 0
49
-            /* Force crop images */
50
-            .featured-or-hero-image img
51
-                object-fit: cover
52
-                object-position: 0% 30%
53
-                max-height: calc($max-card-img-height / 2)
54
-                overflow-y: clip
51
+        /* Force crop images */
52
+        .featured-or-hero-image img
53
+            object-fit: cover
54
+            object-position: 0% 30%
55
+            max-height: calc($max-card-img-height / 2)
56
+            overflow-y: clip
55
     header a
57
     header a
56
         font-size: $ms--2
58
         font-size: $ms--2
57
         text-decoration: none
59
         text-decoration: none
89
 @media (min-width: $medium)
91
 @media (min-width: $medium)
90
     .card
92
     .card
91
         .wide
93
         .wide
92
-            display: flex
93
             padding: 0
94
             padding: 0
95
+            flex-direction: row
94
             grid-gap: $ms-0
96
             grid-gap: $ms-0
95
             a
97
             a
96
                 width: 100%
98
                 width: 100%
99
+                /* Force crop images */
100
+                .featured-or-hero-image img
101
+                    object-fit: cover
102
+                    object-position: 0% 30%
103
+                    max-height: $max-card-img-height
104
+                    overflow-y: clip
97
 </style>
105
 </style>

+ 1
- 1
vue-theme/src/pages/index.vue Näytä tiedosto

83
             await this.$store.dispatch('getAllPages', { sortType: null, params: null })
83
             await this.$store.dispatch('getAllPages', { sortType: null, params: null })
84
         }
84
         }
85
         await this.$store.dispatch('getRandomPosts', ['episode', 'exhibition', 'event', 'artist', 'post'])
85
         await this.$store.dispatch('getRandomPosts', ['episode', 'exhibition', 'event', 'artist', 'post'])
86
-    },
86
+        },
87
     methods: {
87
     methods: {
88
         firstPostOfType(type) {
88
         firstPostOfType(type) {
89
             return Object.values(this[`all${convertTitleCase(type)}s`])[0]
89
             return Object.values(this[`all${convertTitleCase(type)}s`])[0]

+ 18
- 20
vue-theme/src/pages/list.vue Näytä tiedosto

14
                 v-html="allPages[type].content"
14
                 v-html="allPages[type].content"
15
             )
15
             )
16
 
16
 
17
-        ul.posts(v-if="posts && loaded" :class="{ 'is-grid': grid }")
18
-            li(v-for="(post, i) in posts" :key="post.slug").post
19
-                card(:content="post" :type="type" :wide="type == 'exhibition' && i > 1 || type == 'event' && i > 1 ")
17
+        ul.posts.f-col(v-if="posts && loaded" :class="{ 'is-grid': grid }")
18
+            li(v-for="(post, i) in posts" :key="post.slug").post.w-max
19
+                card(:content="post" :type="type" :wide="isWide")
20
         
20
         
21
         //- Important: Do NOT remove this! Required for intersection observer
21
         //- Important: Do NOT remove this! Required for intersection observer
22
         footer
22
         footer
73
             if (!this.pType) return
73
             if (!this.pType) return
74
             return this[`all${this.pType}`]
74
             return this[`all${this.pType}`]
75
         },
75
         },
76
+        isWide() {
77
+            return this.type == 'exhibition' && i > 1 || this.type == 'event' && i > 1 
78
+        }
76
     },
79
     },
77
     methods: {
80
     methods: {
78
         clearAllPosts() {
81
         clearAllPosts() {
227
 @import '../sss/variables.sss'
230
 @import '../sss/variables.sss'
228
 @import '../sss/theme.sss'
231
 @import '../sss/theme.sss'
229
 .page--list
232
 .page--list
230
-    /* background-color: white */
231
     article
233
     article
232
         > header
234
         > header
233
-            /* padding: 1em 0 1em 0 */
234
             padding: 1em
235
             padding: 1em
235
             > h1
236
             > h1
236
                 margin: 0
237
                 margin: 0
238
                 padding: 0
239
                 padding: 0
239
                 width: 100%
240
                 width: 100%
240
         > footer
241
         > footer
241
-            background-color: white
242
             padding: $ms-0
242
             padding: $ms-0
243
         /* posts not grid list */
243
         /* posts not grid list */
244
-        ul img
245
-            max-width: 50%
246
-
247
-        .is-grid
248
-            display: flex
249
-            flex-direction: row
250
-            flex-wrap: wrap
251
-            justify-content: space-between
252
-            section
253
-                width: 32.5%
254
-            ul
244
+        .posts
245
+            list-style: none
246
+            grid-gap: $ms-0
247
+            &.is-grid
248
+                flex-direction: row
255
                 flex-wrap: wrap
249
                 flex-wrap: wrap
256
-                list-style: none
257
-                img
258
-                    max-width: 100%
250
+                justify-content: space-between
251
+                section
252
+                    width: 32.5%
253
+                ul
254
+                    flex-wrap: wrap
255
+                    img
256
+                        max-width: 100%
259
 
257
 
260
 @media (min-width: $medium)
258
 @media (min-width: $medium)
261
     .page--list.f-col
259
     .page--list.f-col

+ 1
- 1
vue-theme/src/sss/variables.sss Näytä tiedosto

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

Loading…
Peruuta
Tallenna