From 78e53bb99f7e0bf77eb2e0c4576358c83f3b1d72 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Thu, 9 May 2024 15:38:43 +0200 Subject: [PATCH] Fix Truncate component for long unbreakable text. (#61137) --- packages/components/src/truncate/hook.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/components/src/truncate/hook.ts b/packages/components/src/truncate/hook.ts index 440865a596432..940e3b0127b08 100644 --- a/packages/components/src/truncate/hook.ts +++ b/packages/components/src/truncate/hook.ts @@ -57,7 +57,7 @@ export default function useTruncate( // breaks even when it contains 'unbreakable' content such as long URLs. // See https://github.com/WordPress/gutenberg/issues/60860. const truncateLines = css` - word-break: break-all; + ${ numberOfLines === 1 ? 'word-break: break-all;' : '' } -webkit-box-orient: vertical; -webkit-line-clamp: ${ numberOfLines }; display: -webkit-box;