Skip to content

Commit fa5f6a0

Browse files
serkodevRobinMalfait
authored andcommitted
Add break-anywhere utility (#12127)
1 parent 31a80b1 commit fa5f6a0

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/corePlugins.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,6 +1538,13 @@ export let corePlugins = {
15381538
'.break-words': { 'overflow-wrap': 'break-word' },
15391539
'.break-all': { 'word-break': 'break-all' },
15401540
'.break-keep': { 'word-break': 'keep-all' },
1541+
'.break-anywhere': {
1542+
'word-break': 'break-word',
1543+
'@supports (overflow-wrap: anywhere)': {
1544+
'overflow-wrap': 'anywhere',
1545+
'word-break': 'normal',
1546+
},
1547+
},
15411548
})
15421549
},
15431550

tests/plugins/__snapshots__/wordBreak.test.js.snap

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,16 @@ exports[`should test the 'wordBreak' plugin 1`] = `
1818
.break-keep {
1919
word-break: keep-all;
2020
}
21+
22+
.break-anywhere {
23+
word-break: break-word;
24+
}
25+
26+
@supports (overflow-wrap: anywhere) {
27+
.break-anywhere {
28+
overflow-wrap: anywhere;
29+
word-break: normal;
30+
}
31+
}
2132
"
2233
`;

0 commit comments

Comments
 (0)