Skip to content

Commit 377c925

Browse files
authored
Merge pull request #768 from tailwindcss/split-word-break-plugin
Split wordBreak plugin from whitespace plugin
2 parents b59944f + 4f20e96 commit 377c925

File tree

4 files changed

+24
-13
lines changed

4 files changed

+24
-13
lines changed

defaultConfig.stub.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ module.exports = {
6767
verticalAlign: ['responsive'],
6868
visibility: ['responsive'],
6969
whitespace: ['responsive'],
70+
wordBreak: ['responsive'],
7071
width: ['responsive'],
7172
zIndex: ['responsive'],
7273
},

src/corePlugins.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ import userSelect from './plugins/userSelect'
6161
import verticalAlign from './plugins/verticalAlign'
6262
import visibility from './plugins/visibility'
6363
import whitespace from './plugins/whitespace'
64+
import wordBreak from './plugins/wordBreak'
6465
import width from './plugins/width'
6566
import zIndex from './plugins/zIndex'
6667

@@ -131,6 +132,7 @@ export default function({ corePlugins: corePluginConfig }) {
131132
verticalAlign,
132133
visibility,
133134
whitespace,
135+
wordBreak,
134136
width,
135137
zIndex,
136138
})

src/plugins/whitespace.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,6 @@ export default function() {
77
'.whitespace-pre': { 'white-space': 'pre' },
88
'.whitespace-pre-line': { 'white-space': 'pre-line' },
99
'.whitespace-pre-wrap': { 'white-space': 'pre-wrap' },
10-
11-
'.break-normal': {
12-
'overflow-wrap': 'normal',
13-
'word-break': 'normal',
14-
},
15-
'.break-words': { 'overflow-wrap': 'break-word' },
16-
'.break-all': { 'word-break': 'break-all' },
17-
18-
'.truncate': {
19-
overflow: 'hidden',
20-
'text-overflow': 'ellipsis',
21-
'white-space': 'nowrap',
22-
},
2310
},
2411
config('variants.whitespace')
2512
)

src/plugins/wordBreak.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
export default function() {
2+
return function({ addUtilities, config }) {
3+
addUtilities(
4+
{
5+
'.break-normal': {
6+
'overflow-wrap': 'normal',
7+
'word-break': 'normal',
8+
},
9+
'.break-words': { 'overflow-wrap': 'break-word' },
10+
'.break-all': { 'word-break': 'break-all' },
11+
12+
'.truncate': {
13+
overflow: 'hidden',
14+
'text-overflow': 'ellipsis',
15+
'white-space': 'nowrap',
16+
},
17+
},
18+
config('variants.wordBreak')
19+
)
20+
}
21+
}

0 commit comments

Comments
 (0)