diff --git a/CHANGELOG.md b/CHANGELOG.md index e5e6f6f89..3371b8f58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Add `@tailwindcss/turbopack` package to run Tailwind CSS with Next.js ([20367](https://github.com/tailwindlabs/tailwindcss/pull/20367)) +- Add `text-stable` utility for CSS `text-wrap: stable` to stabilize editable content line wrapping ([#20519](https://github.com/tailwindlabs/tailwindcss/pull/20519)) ### Fixed diff --git a/packages/tailwindcss/src/utilities.test.ts b/packages/tailwindcss/src/utilities.test.ts index 66b051d57..f8ac1d4ad 100644 --- a/packages/tailwindcss/src/utilities.test.ts +++ b/packages/tailwindcss/src/utilities.test.ts @@ -11994,7 +11994,7 @@ test('tab', async () => { }) test('text-wrap', async () => { - expect(await run(['text-wrap', 'text-nowrap', 'text-balance', 'text-pretty'])) + expect(await run(['text-wrap', 'text-nowrap', 'text-balance', 'text-pretty', 'text-stable'])) .toMatchInlineSnapshot(` " .text-balance { @@ -12009,6 +12009,10 @@ test('text-wrap', async () => { text-wrap: pretty; } + .text-stable { + text-wrap: stable; + } + .text-wrap { text-wrap: wrap; } @@ -12020,10 +12024,12 @@ test('text-wrap', async () => { '-text-nowrap', '-text-balance', '-text-pretty', + '-text-stable', 'text-wrap/foo', 'text-nowrap/foo', 'text-balance/foo', 'text-pretty/foo', + 'text-stable/foo', ]), ).toEqual('') }) diff --git a/packages/tailwindcss/src/utilities.ts b/packages/tailwindcss/src/utilities.ts index 477559d7e..e2a67b2bb 100644 --- a/packages/tailwindcss/src/utilities.ts +++ b/packages/tailwindcss/src/utilities.ts @@ -2359,6 +2359,7 @@ export function createUtilities(theme: Theme) { staticUtility('text-nowrap', [['text-wrap', 'nowrap']]) staticUtility('text-balance', [['text-wrap', 'balance']]) staticUtility('text-pretty', [['text-wrap', 'pretty']]) + staticUtility('text-stable', [['text-wrap', 'stable']]) staticUtility('break-normal', [ ['overflow-wrap', 'normal'], ['word-break', 'normal'],