-
Notifications
You must be signed in to change notification settings - Fork 4.4k
/
Copy pathwordBreak.js
33 lines (31 loc) · 939 Bytes
/
wordBreak.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { flagEnabled } from '../featureFlags'
export default function() {
return function({ addUtilities, variants, config }) {
addUtilities(
{
'.break-normal': {
// For IE 11, remove 'word-wrap' when we have a 'modern' mode
'word-wrap': 'normal',
'overflow-wrap': 'normal',
'word-break': 'normal',
},
'.break-words': {
// For IE 11, remove 'word-wrap' when we have a 'modern' mode
'word-wrap': 'break-word',
'overflow-wrap': 'break-word',
},
'.break-all': { 'word-break': 'break-all' },
...(!flagEnabled(config(), 'moveTruncateToTextOverflow')
? {
'.truncate': {
overflow: 'hidden',
'text-overflow': 'ellipsis',
'white-space': 'nowrap',
},
}
: {}),
},
variants('wordBreak')
)
}
}