Skip to content

Commit

Permalink
Backport #30932
Browse files Browse the repository at this point in the history
Restore word-break: break-word on .text-break to fix text breaking on flex containers
  • Loading branch information
XhmikosR committed Jun 4, 2020
1 parent ac3c2e2 commit 288b9b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion scss/utilities/_text.scss
Expand Up @@ -63,7 +63,8 @@
.text-decoration-none { text-decoration: none !important; }

.text-break {
word-wrap: break-word !important;
word-break: break-word !important; // IE & < Edge 18
overflow-wrap: break-word !important;
}

// Reset
Expand Down
2 changes: 1 addition & 1 deletion site/docs/4.5/utilities/text.md
Expand Up @@ -68,7 +68,7 @@ For longer content, you can add a `.text-truncate` class to truncate the text wi

## Word break

Prevent long strings of text from breaking your components' layout by using `.text-break` to set `word-wrap: break-word`.
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.

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

0 comments on commit 288b9b8

Please sign in to comment.