Skip to content

Commit b4024a4

Browse files
Merge pull request #7538 from Xynash/fix/blog-card-ui-cleanup
[UI] Improve blog card title truncation and spacing
2 parents 08d6036 + b347ee6 commit b4024a4

1 file changed

Lines changed: 29 additions & 7 deletions

File tree

src/components/Card/Card.style.js

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,36 +87,50 @@ export const CardWrapper = styled.div`
8787
}
8888
8989
.post-content-block {
90-
padding: 1rem 2rem;
91-
height: 8rem;
90+
padding: 1rem 2rem 1.5rem 2rem;
91+
height: auto;
92+
min-height: 10rem;
93+
display: flex;
94+
flex-direction: column;
95+
justify-content: space-between;
9296
}
9397
9498
@media screen and (max-width: 1200px) and (min-width: 992px) {
9599
.post-thumb-block {
96-
height: 12rem;
100+
height: auto;
101+
min-height: 10rem;
97102
}
98103
99104
.post-content-block {
100-
height: 10rem;
105+
height: auto;
106+
min-height: 10rem;
101107
}
102108
}
103109
104110
@media screen and (max-width: 670px) and (min-width: 560px) {
105111
.post-content-block {
106-
height: 10rem;
112+
height: auto;
113+
min-height: 10rem;
107114
}
108115
}
109116
110117
@media screen and (max-width: 350px) {
111118
.post-content-block {
112-
height: 10rem;
119+
height: auto;
120+
min-height: 10rem;
113121
}
114122
}
115123
116124
.post-title {
117125
font-size: 1.4rem;
118126
font-weight: 400;
119-
white-space: nowrap;
127+
margin: 0 0 0.5rem 0;
128+
padding: 0;
129+
130+
white-space: normal;
131+
display: -webkit-box;
132+
-webkit-line-clamp: 2;
133+
-webkit-box-orient: vertical;
120134
overflow: hidden;
121135
text-overflow: ellipsis;
122136
}
@@ -125,9 +139,14 @@ export const CardWrapper = styled.div`
125139
height: auto;
126140
display: flex;
127141
margin-bottom: 0.5rem;
142+
white-space: nowrap;
143+
overflow: hidden;
144+
text-overflow: ellipsis;
128145
129146
.author {
130147
text-align: end;
148+
overflow: hidden;
149+
text-overflow: ellipsis;
131150
}
132151
.author,
133152
p {
@@ -136,6 +155,9 @@ export const CardWrapper = styled.div`
136155
font-weight: 400;
137156
flex: auto;
138157
transition: 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
158+
white-space: nowrap;
159+
overflow: hidden;
160+
text-overflow: ellipsis;
139161
}
140162
.type {
141163
text-align: end;

0 commit comments

Comments
 (0)