Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix text-break in IE and Edge Legacy #31727

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 13 additions & 2 deletions scss/utilities/_text.scss
Expand Up @@ -63,8 +63,19 @@
.text-decoration-none { text-decoration: none !important; }

.text-break {
word-break: break-word !important; // IE & < Edge 18
overflow-wrap: break-word !important;
// We wan't to use `overflow-wrap: anywhere` to avoid issues with flex containers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mdo this whole section needs grammar fixes and personally I find it too verbose

// But `overflow-wrap` don't supported by IE and Edge Legacy at all
// and `overflow-wrap: anywhere` don't supported by Safari.
// So we use combination of word-break (modern browsers) + word-wrap (IE/Edge Legacy)

// This value deprecated for modern browsers (and never supported by IE/Edge Legacy)
// The same as `word-break: normal` and `overflow-wrap: anywhere` (regardless of the actual value of the overflow-wrap property)
word-break: break-word !important; // all browsers except IE/Edge Legacy, working inside flex

// Because `word-break: break-word` don't supported by IE/Edge Legacy we adding `word-wrap: break-word` which is old name for `overflow-wrap: break-word`.
// The same as `overflow-wrap: break-word`
// all browsers except IE/Edge legacy ignore it because of `word-break: break-word` above
word-wrap: break-word !important; // for IE/Edge Legacy, DON'T working inside flex
}

// Reset
Expand Down