From 82d83910139aca2826033c395e3ff64c1a826f34 Mon Sep 17 00:00:00 2001 From: Frankie Roberto Date: Tue, 19 Nov 2024 15:22:24 +0000 Subject: [PATCH] Add second class for other contexts. --- packages/core/utilities/_word-breaks.scss | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/core/utilities/_word-breaks.scss b/packages/core/utilities/_word-breaks.scss index ca7ebc6a9..f14cfc601 100644 --- a/packages/core/utilities/_word-breaks.scss +++ b/packages/core/utilities/_word-breaks.scss @@ -14,3 +14,16 @@ .nhsuk-u-word-break-all { word-break: break-all; } + + +/** + * This class also allows words to be broken between any 2 + * to avoid overflowing their container, but will try + * and avoid it by placing the entire word on its own + * line first. However this does not work in tables. + * + * Usage: class="nhsuk-u-word-break-all" + */ +.nhsuk-u-word-break-word { + overflow-wrap: break-word; +}