Skip to content

Commit

Permalink
Add support for text-wrap property
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwathan committed May 30, 2023
1 parent e1d4955 commit 88de7a4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/corePlugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -1523,6 +1523,14 @@ export let corePlugins = {
})
},

textWrap: ({ addUtilities }) => {
addUtilities({
'.text-wrap': { 'text-wrap': 'wrap' },
'.text-nowrap': { 'text-wrap': 'nowrap' },
'.text-balance': { 'text-wrap': 'wrap' },
})
},

wordBreak: ({ addUtilities }) => {
addUtilities({
'.break-normal': { 'overflow-wrap': 'normal', 'word-break': 'normal' },
Expand Down
9 changes: 9 additions & 0 deletions tests/basic-usage.test.css
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,15 @@
.whitespace-nowrap {
white-space: nowrap;
}
.text-wrap {
text-wrap: wrap;
}
.text-nowrap {
text-wrap: nowrap;
}
.text-balance {
text-wrap: wrap;
}
.break-words {
overflow-wrap: break-word;
}
Expand Down
1 change: 1 addition & 0 deletions tests/basic-usage.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ test('basic usage', () => {
<div class="invisible"></div>
<div class="collapse"></div>
<div class="whitespace-nowrap"></div>
<div class="text-wrap text-balance text-nowrap"></div>
<div class="w-12"></div>
<div class="break-words"></div>
<div class="z-30"></div>
Expand Down

0 comments on commit 88de7a4

Please sign in to comment.