소스 검색

:art: hardcore line-clamping

tags/0.9.0
J 4 년 전
부모
커밋
57adec32a8
3개의 변경된 파일12개의 추가작업 그리고 3개의 파일을 삭제
  1. 7
    3
      vue-theme/src/components/card.vue
  2. 4
    0
      vue-theme/src/pages/index.vue
  3. 1
    0
      vue-theme/src/sss/variables.sss

+ 7
- 3
vue-theme/src/components/card.vue 파일 보기

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

+ 4
- 0
vue-theme/src/pages/index.vue 파일 보기

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

+ 1
- 0
vue-theme/src/sss/variables.sss 파일 보기

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

Loading…
취소
저장