Navigation: truncate landing page descriptions to 3 lines (#61925)

* truncate landing page descriptions to 3 lines

* use correct css prop names
This commit is contained in:
Ashley Harrison 2023-01-23 17:07:36 +00:00 committed by GitHub
parent 3eb065339f
commit 6b53f927b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -51,7 +51,7 @@ const getStyles = (theme: GrafanaTheme2) => ({
display: 'grid',
gap: theme.spacing(3),
gridTemplateColumns: 'repeat(auto-fill, minmax(300px, 1fr))',
gridAutoRows: '130px',
gridAutoRows: '138px',
padding: theme.spacing(2, 0),
}),
});

View File

@ -15,7 +15,7 @@ export function NavLandingPageCard({ description, text, url }: Props) {
return (
<Card className={styles.card} href={url}>
<Card.Heading>{text}</Card.Heading>
<Card.Description>{description}</Card.Description>
<Card.Description className={styles.description}>{description}</Card.Description>
</Card>
);
}
@ -25,4 +25,12 @@ const getStyles = (theme: GrafanaTheme2) => ({
marginBottom: 0,
gridTemplateRows: '1fr 0 2fr',
}),
// Limit descriptions to 3 lines max before ellipsing
// Some plugin descriptions can be very long
description: css({
WebkitLineClamp: 3,
WebkitBoxOrient: 'vertical',
display: '-webkit-box',
overflow: 'hidden',
}),
});