Skip to content

Commit 2ceadd1

Browse files
committed
Add support for text-wrap property
Update changelog
1 parent e1d4955 commit 2ceadd1

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2424
- Process and inline `@import` at-rules natively ([#11239](https://github.com/tailwindlabs/tailwindcss/pull/11239))
2525
- Add `svh`, `lvh`, and `dvh` values to default `height`/`min-height`/`max-height` theme ([#11317](https://github.com/tailwindlabs/tailwindcss/pull/11317))
2626
- Add `has-*` variants for `:has(...)` pseudo-class ([#11318](https://github.com/tailwindlabs/tailwindcss/pull/11318))
27+
- Add `text-wrap` utilities including `text-balance` ([#11320](https://github.com/tailwindlabs/tailwindcss/pull/11320))
2728

2829
### Changed
2930

src/corePlugins.js

+8
Original file line numberDiff line numberDiff line change
@@ -1523,6 +1523,14 @@ export let corePlugins = {
15231523
})
15241524
},
15251525

1526+
textWrap: ({ addUtilities }) => {
1527+
addUtilities({
1528+
'.text-wrap': { 'text-wrap': 'wrap' },
1529+
'.text-nowrap': { 'text-wrap': 'nowrap' },
1530+
'.text-balance': { 'text-wrap': 'balance' },
1531+
})
1532+
},
1533+
15261534
wordBreak: ({ addUtilities }) => {
15271535
addUtilities({
15281536
'.break-normal': { 'overflow-wrap': 'normal', 'word-break': 'normal' },

tests/basic-usage.test.css

+9
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,15 @@
597597
.whitespace-nowrap {
598598
white-space: nowrap;
599599
}
600+
.text-wrap {
601+
text-wrap: wrap;
602+
}
603+
.text-nowrap {
604+
text-wrap: nowrap;
605+
}
606+
.text-balance {
607+
text-wrap: balance;
608+
}
600609
.break-words {
601610
overflow-wrap: break-word;
602611
}

tests/basic-usage.test.js

+1
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ test('basic usage', () => {
192192
<div class="invisible"></div>
193193
<div class="collapse"></div>
194194
<div class="whitespace-nowrap"></div>
195+
<div class="text-wrap text-balance text-nowrap"></div>
195196
<div class="w-12"></div>
196197
<div class="break-words"></div>
197198
<div class="z-30"></div>

0 commit comments

Comments
 (0)