Skip to content

Commit

Permalink
Add break-anywhere utility (#12127)
Browse files Browse the repository at this point in the history
  • Loading branch information
serkodev authored and RobinMalfait committed Oct 9, 2023
1 parent 31a80b1 commit fa5f6a0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/corePlugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -1538,6 +1538,13 @@ export let corePlugins = {
'.break-words': { 'overflow-wrap': 'break-word' },
'.break-all': { 'word-break': 'break-all' },
'.break-keep': { 'word-break': 'keep-all' },
'.break-anywhere': {
'word-break': 'break-word',
'@supports (overflow-wrap: anywhere)': {
'overflow-wrap': 'anywhere',
'word-break': 'normal',
},
},
})
},

Expand Down
11 changes: 11 additions & 0 deletions tests/plugins/__snapshots__/wordBreak.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,16 @@ exports[`should test the 'wordBreak' plugin 1`] = `
.break-keep {
word-break: keep-all;
}
.break-anywhere {
word-break: break-word;
}
@supports (overflow-wrap: anywhere) {
.break-anywhere {
overflow-wrap: anywhere;
word-break: normal;
}
}
"
`;

0 comments on commit fa5f6a0

Please sign in to comment.