Kaynağa Gözat

:art: hardcore line-clamping

tags/0.9.0
J 4 yıl önce
ebeveyn
işleme
57adec32a8

+ 7
- 3
vue-theme/src/components/card.vue Dosyayı Görüntüle

@@ -44,7 +44,6 @@ export default {
44 44
     overflow: hidden
45 45
     text-overflow: clip
46 46
     &--info
47
-        justify-content: center
48 47
         > a
49 48
             line-height: 0
50 49
             /* Force crop images */
@@ -69,6 +68,10 @@ export default {
69 68
         font-size: $ms-0
70 69
         padding: 0
71 70
         line-height: initial
71
+        display: -webkit-box
72
+        -webkit-line-clamp: $card-line-clamp
73
+        -webkit-box-orient: vertical
74
+        overflow-y: clip
72 75
     p
73 76
         &.datetime
74 77
             font-size: $ms--1
@@ -76,14 +79,15 @@ export default {
76 79
         &.excerpt
77 80
             overflow: hidden
78 81
             margin: 0
82
+            -webkit-line-clamp: $card-line-clamp
83
+            -webkit-box-orient: vertical
84
+            display: -webkit-box
79 85
         &.read-more
80 86
             font-size: $ms--1
81 87
     
82 88
 /* for widths larger than 768px */
83 89
 @media (min-width: $medium)
84 90
     .card
85
-        &--info 
86
-            justify-content: center
87 91
         .wide
88 92
             display: flex
89 93
             padding: 0

+ 4
- 0
vue-theme/src/pages/index.vue Dosyayı Görüntüle

@@ -111,6 +111,8 @@ export default {
111 111
                     margin: 0 0 $ms-0 0
112 112
                     .featured-or-hero-image img
113 113
                         max-height: $max-card-img-height
114
+                    p.excerpt
115
+                        -webkit-line-clamp: calc($card-line-clamp * 2)
114 116
             &.max 
115 117
                 margin: 0
116 118
                 > ul
@@ -135,6 +137,8 @@ export default {
135 137
                 margin: 0
136 138
                 min-height: 10em
137 139
                 &:nth-of-type(2), &:nth-of-type(3), &:nth-of-type(4), &:nth-of-type(5)
140
+                    p.excerpt
141
+                        -webkit-line-clamp: calc($card-line-clamp * 2)
138 142
                     .featured-or-hero-image img
139 143
                         max-height: calc($max-card-img-height / 2)
140 144
                 /* n1 episode */

+ 1
- 0
vue-theme/src/sss/variables.sss Dosyayı Görüntüle

@@ -13,6 +13,7 @@ $path: 4px
13 13
 $base: 0.95em
14 14
 
15 15
 $max-card-img-height: 260px
16
+$card-line-clamp: 3
16 17
 
17 18
 $ratio: $minor-third
18 19
 /* $ratio = 1.2 from _ratios.sss */

Loading…
İptal
Kaydet