From 36917ce30c56657406bf7bb77ce84f01030aec1a Mon Sep 17 00:00:00 2001 From: Huzaifa Iftikhar Date: Sun, 30 Aug 2026 21:58:24 +0500 Subject: [PATCH] scan the variant value instead of matching it with a regex the four regex rules could only reach a fixed nesting depth so an object inside a condition or a brace inside a string still got through. this walks the value from the prop until whatever ends its own syntax so there is no depth limit any more. it also drops two over guards the regexes had. a class inside a call in a variant prop migrates again and so does a class next to an attribute that only mentions variant in its text. --- .../template/is-safe-migration.test.ts | 11 +++ .../codemods/template/is-safe-migration.ts | 96 ++++++++++++------- 2 files changed, 75 insertions(+), 32 deletions(-) diff --git a/packages/@tailwindcss-upgrade/src/codemods/template/is-safe-migration.test.ts b/packages/@tailwindcss-upgrade/src/codemods/template/is-safe-migration.test.ts index 5ab859b4f..0117cfa3e 100644 --- a/packages/@tailwindcss-upgrade/src/codemods/template/is-safe-migration.test.ts +++ b/packages/@tailwindcss-upgrade/src/codemods/template/is-safe-migration.test.ts @@ -132,6 +132,10 @@ describe('is-safe-migration', async () => { [`