Skip to content

Commit

Permalink
Use @supports not for break-anywhere polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
serkodev authored and RobinMalfait committed Oct 9, 2023
1 parent fa5f6a0 commit e02d323
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/corePlugins.js
Expand Up @@ -1539,10 +1539,11 @@ export let corePlugins = {
'.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',
},
'@supports not (overflow-wrap: anywhere)': {
'word-break': 'break-word',
},
},
})
Expand Down
11 changes: 6 additions & 5 deletions tests/plugins/__snapshots__/wordBreak.test.js.snap
Expand Up @@ -19,14 +19,15 @@ exports[`should test the 'wordBreak' plugin 1`] = `
word-break: keep-all;
}
.break-anywhere {
word-break: break-word;
}
@supports (overflow-wrap: anywhere) {
.break-anywhere {
overflow-wrap: anywhere;
word-break: normal;
}
}
@supports not (overflow-wrap: anywhere) {
.break-anywhere {
word-break: break-word;
}
}
"
Expand Down

0 comments on commit e02d323

Please sign in to comment.