Use word-wrap and overflow-wrap since word-wrap is not supported in Chrome et al

This commit is contained in:
Adam Wathan 2020-10-14 15:23:24 -04:00
parent 038afedfac
commit 6bb7cd4e9e

View File

@ -1,14 +1,18 @@
export default function() {
return function({ addUtilities, variants, target }) {
const wrapPropertyName = target('wordBreak') === 'ie11' ? 'word-wrap' : 'overflow-wrap'
return function({ addUtilities, variants }) {
addUtilities(
{
'.break-normal': {
[wrapPropertyName]: 'normal',
// For IE 11, remove 'word-wrap' when we have a 'modern' mode
'word-wrap': 'normal',
'overflow-wrap': 'normal',
'word-break': 'normal',
},
'.break-words': { [wrapPropertyName]: 'break-word' },
'.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' },
'.truncate': {