Skip to content

Commit 6bb7cd4

Browse files
committed
Use word-wrap and overflow-wrap since word-wrap is not supported in Chrome et al
1 parent 038afed commit 6bb7cd4

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/plugins/wordBreak.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
export default function() {
2-
return function({ addUtilities, variants, target }) {
3-
const wrapPropertyName = target('wordBreak') === 'ie11' ? 'word-wrap' : 'overflow-wrap'
4-
2+
return function({ addUtilities, variants }) {
53
addUtilities(
64
{
75
'.break-normal': {
8-
[wrapPropertyName]: 'normal',
6+
// For IE 11, remove 'word-wrap' when we have a 'modern' mode
7+
'word-wrap': 'normal',
8+
'overflow-wrap': 'normal',
99
'word-break': 'normal',
1010
},
11-
'.break-words': { [wrapPropertyName]: 'break-word' },
11+
'.break-words': {
12+
// For IE 11, remove 'word-wrap' when we have a 'modern' mode
13+
'word-wrap': 'break-word',
14+
'overflow-wrap': 'break-word',
15+
},
1216
'.break-all': { 'word-break': 'break-all' },
1317

1418
'.truncate': {

0 commit comments

Comments
 (0)