diff --git a/CHANGELOG.md b/CHANGELOG.md index 8199cf115df5..5aa43abd24f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Process and inline `@import` at-rules natively ([#11239](https://github.com/tailwindlabs/tailwindcss/pull/11239)) - Add `svh`, `lvh`, and `dvh` values to default `height`/`min-height`/`max-height` theme ([#11317](https://github.com/tailwindlabs/tailwindcss/pull/11317)) - Add `has-*` variants for `:has(...)` pseudo-class ([#11318](https://github.com/tailwindlabs/tailwindcss/pull/11318)) +- Add `text-wrap` utilities including `text-balance` ([#11320](https://github.com/tailwindlabs/tailwindcss/pull/11320)) ### Changed diff --git a/src/corePlugins.js b/src/corePlugins.js index 15b4e8d0354d..00ceab259a82 100644 --- a/src/corePlugins.js +++ b/src/corePlugins.js @@ -1523,6 +1523,14 @@ export let corePlugins = { }) }, + textWrap: ({ addUtilities }) => { + addUtilities({ + '.text-wrap': { 'text-wrap': 'wrap' }, + '.text-nowrap': { 'text-wrap': 'nowrap' }, + '.text-balance': { 'text-wrap': 'balance' }, + }) + }, + wordBreak: ({ addUtilities }) => { addUtilities({ '.break-normal': { 'overflow-wrap': 'normal', 'word-break': 'normal' }, diff --git a/tests/basic-usage.test.css b/tests/basic-usage.test.css index 8d1ba2da8dd1..80c406bf6bbd 100644 --- a/tests/basic-usage.test.css +++ b/tests/basic-usage.test.css @@ -597,6 +597,15 @@ .whitespace-nowrap { white-space: nowrap; } +.text-wrap { + text-wrap: wrap; +} +.text-nowrap { + text-wrap: nowrap; +} +.text-balance { + text-wrap: balance; +} .break-words { overflow-wrap: break-word; } diff --git a/tests/basic-usage.test.js b/tests/basic-usage.test.js index 216ca06009ab..c34ba8aeeaa5 100644 --- a/tests/basic-usage.test.js +++ b/tests/basic-usage.test.js @@ -192,6 +192,7 @@ test('basic usage', () => {
+