Skip to content

Commit 9caa954

Browse files
adamwathanthecrypticace
authored andcommitted
Add support for text-wrap property (#11320)
Update changelog Co-authored-by: Adam Wathan <[email protected]>
1 parent d72c189 commit 9caa954

5 files changed

+28
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- Add `svh`, `lvh`, and `dvh` values to default `height`/`min-height`/`max-height` theme ([#11317](https://github.com/tailwindlabs/tailwindcss/pull/11317))
1313
- Add `has-*` variants for `:has(...)` pseudo-class ([#11318](https://github.com/tailwindlabs/tailwindcss/pull/11318))
14+
- Add `text-wrap` utilities including `text-balance` ([#11320](https://github.com/tailwindlabs/tailwindcss/pull/11320))
1415

1516
## [3.3.7] - 2023-12-18
1617

src/corePlugins.js

+8
Original file line numberDiff line numberDiff line change
@@ -1529,6 +1529,14 @@ export let corePlugins = {
15291529
})
15301530
},
15311531

1532+
textWrap: ({ addUtilities }) => {
1533+
addUtilities({
1534+
'.text-wrap': { 'text-wrap': 'wrap' },
1535+
'.text-nowrap': { 'text-wrap': 'nowrap' },
1536+
'.text-balance': { 'text-wrap': 'balance' },
1537+
})
1538+
},
1539+
15321540
wordBreak: ({ addUtilities }) => {
15331541
addUtilities({
15341542
'.break-normal': { 'overflow-wrap': 'normal', 'word-break': 'normal' },

tests/basic-usage.oxide.test.css

+9
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,15 @@
593593
.whitespace-nowrap {
594594
white-space: nowrap;
595595
}
596+
.text-wrap {
597+
text-wrap: wrap;
598+
}
599+
.text-nowrap {
600+
text-wrap: nowrap;
601+
}
602+
.text-balance {
603+
text-wrap: balance;
604+
}
596605
.break-words {
597606
overflow-wrap: break-word;
598607
}

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
@@ -193,6 +193,7 @@ crosscheck(({ stable, oxide, engine }) => {
193193
<div class="invisible"></div>
194194
<div class="collapse"></div>
195195
<div class="whitespace-nowrap"></div>
196+
<div class="text-wrap text-balance text-nowrap"></div>
196197
<div class="w-12"></div>
197198
<div class="break-words"></div>
198199
<div class="z-30"></div>

0 commit comments

Comments
 (0)