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 committed Oct 3, 2023
1 parent 82e0ace commit fba49ce
Show file tree
Hide file tree
Showing 2 changed files with 16 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
9 changes: 9 additions & 0 deletions tests/plugins/wordBreak.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,13 @@ quickPluginTest('wordBreak').toMatchFormattedCss(css`
.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 fba49ce

Please sign in to comment.