From 13d7eef08eff721c192c4d6cf46cfced80bc9db3 Mon Sep 17 00:00:00 2001 From: SerKo Date: Sat, 30 Nov 2024 21:07:04 +0800 Subject: [PATCH 1/2] Add `break-anywhere` utility --- packages/tailwindcss/src/utilities.test.ts | 6 +++++- packages/tailwindcss/src/utilities.ts | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/tailwindcss/src/utilities.test.ts b/packages/tailwindcss/src/utilities.test.ts index 3f1b25333112..5013d1efd736 100644 --- a/packages/tailwindcss/src/utilities.test.ts +++ b/packages/tailwindcss/src/utilities.test.ts @@ -9210,13 +9210,17 @@ test('text-wrap', async () => { }) test('overflow-wrap', async () => { - expect(await run(['break-normal', 'break-words', 'break-all', 'break-keep'])) + expect(await run(['break-normal', 'break-words', 'break-all', 'break-keep', 'break-anywhere'])) .toMatchInlineSnapshot(` ".break-normal { overflow-wrap: normal; word-break: normal; } + .break-anywhere { + overflow-wrap: anywhere; + } + .break-words { overflow-wrap: break-word; } diff --git a/packages/tailwindcss/src/utilities.ts b/packages/tailwindcss/src/utilities.ts index a544403025d3..159324774dd0 100644 --- a/packages/tailwindcss/src/utilities.ts +++ b/packages/tailwindcss/src/utilities.ts @@ -1973,6 +1973,7 @@ export function createUtilities(theme: Theme) { staticUtility('break-words', [['overflow-wrap', 'break-word']]) staticUtility('break-all', [['word-break', 'break-all']]) staticUtility('break-keep', [['word-break', 'keep-all']]) + staticUtility('break-anywhere', [['overflow-wrap', 'anywhere']]) { // border-radius From 8b4da03d6ef4ed1c51eceb1ace64671ca42650c0 Mon Sep 17 00:00:00 2001 From: SerKo Date: Sat, 30 Nov 2024 21:21:23 +0800 Subject: [PATCH 2/2] Update `break-anywhere` test unit --- .../tailwindcss/src/__snapshots__/intellisense.test.ts.snap | 1 + packages/tailwindcss/src/utilities.test.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/packages/tailwindcss/src/__snapshots__/intellisense.test.ts.snap b/packages/tailwindcss/src/__snapshots__/intellisense.test.ts.snap index 13bb9a8789ee..db860118ab0d 100644 --- a/packages/tailwindcss/src/__snapshots__/intellisense.test.ts.snap +++ b/packages/tailwindcss/src/__snapshots__/intellisense.test.ts.snap @@ -3202,6 +3202,7 @@ exports[`getClassList 1`] = ` "break-after-page", "break-after-right", "break-all", + "break-anywhere", "break-before-all", "break-before-auto", "break-before-avoid", diff --git a/packages/tailwindcss/src/utilities.test.ts b/packages/tailwindcss/src/utilities.test.ts index 5013d1efd736..8a18f039e752 100644 --- a/packages/tailwindcss/src/utilities.test.ts +++ b/packages/tailwindcss/src/utilities.test.ts @@ -9239,10 +9239,12 @@ test('overflow-wrap', async () => { '-break-words', '-break-all', '-break-keep', + '-break-anywhere', 'break-normal/foo', 'break-words/foo', 'break-all/foo', 'break-keep/foo', + 'break-anywhere/foo', ]), ).toEqual('') })