From 3ab98f0533536cbf7f4e91fdfb1688f9ec036e50 Mon Sep 17 00:00:00 2001 From: Philipp Spiess Date: Fri, 29 Nov 2024 17:00:15 +0100 Subject: [PATCH] Upgrade: Do not migrate `overflow-clip` utility (#15244) `overflow-clip` was the name for `text-clip` in v4. However, that was changed in v3 already so in v3 `overflow-clip` is already doing the same as in v4. Hence a codemod is not necessary. Co-authored-by: Adam Wathan --- CHANGELOG.md | 1 + .../src/template/codemods/simple-legacy-classes.test.ts | 4 +++- .../src/template/codemods/simple-legacy-classes.ts | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a75ef940f67..4e5e3d89b2d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Don't scan source files for utilities unless `@tailwind utilities` is present in the CSS in `@tailwindcss/postcss` and `@tailwindcss/vite` ([#15226](https://github.com/tailwindlabs/tailwindcss/pull/15226)) - Skip reserializing CSS files that don't use Tailwind features in `@tailwindcss/postcss` and `@tailwindcss/vite` ([#15226](https://github.com/tailwindlabs/tailwindcss/pull/15226)) +- _Upgrade (experimental)_: Do not migrate the `overflow-clip` utility ([#15244](https://github.com/tailwindlabs/tailwindcss/pull/15244)) ## [4.0.0-beta.3] - 2024-11-27 diff --git a/packages/@tailwindcss-upgrade/src/template/codemods/simple-legacy-classes.test.ts b/packages/@tailwindcss-upgrade/src/template/codemods/simple-legacy-classes.test.ts index 000d16d4f0d5..a9da9e54e036 100644 --- a/packages/@tailwindcss-upgrade/src/template/codemods/simple-legacy-classes.test.ts +++ b/packages/@tailwindcss-upgrade/src/template/codemods/simple-legacy-classes.test.ts @@ -3,7 +3,6 @@ import { expect, test } from 'vitest' import { simpleLegacyClasses } from './simple-legacy-classes' test.each([ - ['overflow-clip', 'text-clip'], ['overflow-ellipsis', 'text-ellipsis'], ['flex-grow', 'grow'], ['flex-grow-0', 'grow-0'], @@ -17,6 +16,9 @@ test.each([ ['max-lg:hover:!decoration-slice', 'max-lg:hover:box-decoration-slice!'], ['focus:outline-none', 'focus:outline-hidden'], + + // Should not convert v2 utilities + ['overflow-clip', 'overflow-clip'], ])('%s => %s', async (candidate, result) => { let designSystem = await __unstable__loadDesignSystem('@import "tailwindcss";', { base: __dirname, diff --git a/packages/@tailwindcss-upgrade/src/template/codemods/simple-legacy-classes.ts b/packages/@tailwindcss-upgrade/src/template/codemods/simple-legacy-classes.ts index a2c2b77f11f4..1251d0f2d15c 100644 --- a/packages/@tailwindcss-upgrade/src/template/codemods/simple-legacy-classes.ts +++ b/packages/@tailwindcss-upgrade/src/template/codemods/simple-legacy-classes.ts @@ -5,7 +5,6 @@ import { printCandidate } from '../candidates' // Classes that used to exist in Tailwind CSS v3, but do not exist in Tailwind // CSS v4 anymore. const LEGACY_CLASS_MAP = { - 'overflow-clip': 'text-clip', 'overflow-ellipsis': 'text-ellipsis', 'flex-grow': 'grow',