Skip to content

Commit cd9b140

Browse files
committed
Use @supports not for break-anywhere polyfill
1 parent fba49ce commit cd9b140

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/corePlugins.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1539,10 +1539,11 @@ export let corePlugins = {
15391539
'.break-all': { 'word-break': 'break-all' },
15401540
'.break-keep': { 'word-break': 'keep-all' },
15411541
'.break-anywhere': {
1542-
'word-break': 'break-word',
15431542
'@supports (overflow-wrap: anywhere)': {
15441543
'overflow-wrap': 'anywhere',
1545-
'word-break': 'normal',
1544+
},
1545+
'@supports not (overflow-wrap: anywhere)': {
1546+
'word-break': 'break-word',
15461547
},
15471548
},
15481549
})

tests/plugins/wordBreak.test.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ quickPluginTest('wordBreak').toMatchFormattedCss(css`
1414
.break-keep {
1515
word-break: keep-all;
1616
}
17-
.break-anywhere {
18-
word-break: break-word;
19-
}
2017
@supports (overflow-wrap: anywhere) {
2118
.break-anywhere {
2219
overflow-wrap: anywhere;
23-
word-break: normal;
20+
}
21+
}
22+
@supports not (overflow-wrap: anywhere) {
23+
.break-anywhere {
24+
word-break: break-word;
2425
}
2526
}
2627
`)

0 commit comments

Comments
 (0)