Skip to content

Commit 2d39ef6

Browse files
committed
Backport #30932
Restore word-break: break-word on .text-break to fix text breaking on flex containers
1 parent 21744d1 commit 2d39ef6

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

scss/utilities/_text.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@
6363
.text-decoration-none { text-decoration: none !important; }
6464

6565
.text-break {
66-
word-wrap: break-word !important;
66+
word-break: break-word !important; // IE & < Edge 18
67+
overflow-wrap: break-word !important;
6768
}
6869

6970
// Reset

site/docs/4.5/utilities/text.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ For longer content, you can add a `.text-truncate` class to truncate the text wi
6868

6969
## Word break
7070

71-
Prevent long strings of text from breaking your components' layout by using `.text-break` to set `word-wrap: break-word`.
71+
Prevent long strings of text from breaking your components' layout by using `.text-break` to set `word-wrap: break-word` and `word-break: break-word`. We use `word-wrap` instead of the more common `overflow-wrap` for wider browser support, and add the deprecated `word-break: break-word` to avoid issues with flex containers.
7272

7373
{% capture example %}
7474
<p class="text-break">mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm</p>

0 commit comments

Comments
 (0)