Skip to content

Commit 72cb531

Browse files
author
Martin Rohrmeier
authored
fix(UI): card component spaces
2 parents 27e1eb4 + b4f4eed commit 72cb531

File tree

2 files changed

+31
-9
lines changed

2 files changed

+31
-9
lines changed

src/components/content/Cards/Card.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,9 @@ export const Card = ({
310310
)}
311311
</Box>
312312
<Box
313-
sx={{ marginBottom: '20px' }}
313+
sx={{
314+
marginBottom: '20px',
315+
}}
314316
className="cx-card__content--wrapper"
315317
>
316318
{statusText && imageSize === 'small' && showStatus && (

src/components/content/Cards/CardContent.tsx

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,28 +39,39 @@ export const CardContent = ({
3939
description,
4040
}: CardContentProps) => {
4141
return (
42-
<Box sx={{ padding: '20px' }} className="cx-card__content">
43-
<Box sx={{ height: '35px' }}>
42+
<Box
43+
sx={{ padding: '20px', overflowWrap: 'break-word' }}
44+
className="cx-card__content"
45+
>
46+
<Box sx={{ height: '35px', mb: '10px' }}>
4447
{subtitle && (
4548
<Typography
4649
variant="label3"
47-
sx={{ color: 'text.tertiary', display: 'inline-block' }}
50+
sx={{
51+
color: 'text.tertiary',
52+
overflow: 'hidden',
53+
display: '-webkit-box',
54+
WebkitBoxOrient: 'vertical',
55+
WebkitLineClamp: '2',
56+
lineHeight: '20px',
57+
}}
4858
>
4959
{subtitle}
5060
</Typography>
5161
)}
5262
</Box>
53-
<Box sx={{ height: '35px' }}>
63+
<Box sx={{ height: '35px', mb: '10px' }}>
5464
<Typography
5565
variant="h5"
5666
sx={{
5767
marginTop: 0.5,
5868
overflow: 'hidden',
5969
textOverflow: 'ellipsis',
6070
whiteSpace: 'normal',
61-
display: 'box',
62-
lineClamp: '2',
63-
boxOrient: 'vertical',
71+
display: '-webkit-box',
72+
WebkitLineClamp: '2',
73+
WebkitBoxOrient: 'vertical',
74+
lineHeight: '20px',
6475
}}
6576
>
6677
{title}
@@ -80,7 +91,16 @@ export const CardContent = ({
8091
</Box>
8192
)}
8293
{description && (
83-
<Typography variant="body3" sx={{ marginTop: 1.5 }}>
94+
<Typography
95+
variant="body3"
96+
sx={{
97+
marginTop: 1.5,
98+
overflow: 'hidden',
99+
display: '-webkit-box',
100+
WebkitBoxOrient: 'vertical',
101+
WebkitLineClamp: '2',
102+
}}
103+
>
84104
{description}
85105
</Typography>
86106
)}

0 commit comments

Comments
 (0)