From de11397726af8cf11e7b267cf24591482efb4391 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oddbj=C3=B8rn=20=C3=98vernes?= Date: Thu, 21 Dec 2023 11:28:33 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Typography:=20Fix=20line=20clamp?= =?UTF-8?q?=20bug=20for=20styled=20v6=20(#3193)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/Typography/Typography.tsx | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/packages/eds-core-react/src/components/Typography/Typography.tsx b/packages/eds-core-react/src/components/Typography/Typography.tsx index 410ce90bd7..9882ee4ca3 100644 --- a/packages/eds-core-react/src/components/Typography/Typography.tsx +++ b/packages/eds-core-react/src/components/Typography/Typography.tsx @@ -85,16 +85,13 @@ const StyledTypography = styled.p` ${({ $typography, $link }) => typographyTemplate($typography, $link)} ${({ $color }) => css({ color: findColor($color) })} ${({ $lines }) => - //https://caniuse.com/#feat=css-line-clamp - $lines > 0 && + $lines && css` - & { - display: -webkit-box; - -webkit-line-clamp: ${$lines}; - -webkit-box-orient: vertical; - overflow: hidden; - text-overflow: ellipsis; - } + display: -webkit-box; + -webkit-line-clamp: ${$lines}; + -webkit-box-orient: vertical; + overflow: hidden; + text-overflow: ellipsis; `} ${({ $link }) => $link &&