Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v4] Tailwind v4 upgrade script renames camelCase'd colors/fonts to kebab-case, but does not update usages. #16156

Open
nicksergeant opened this issue Feb 1, 2025 · 0 comments

Comments

@nicksergeant
Copy link

nicksergeant commented Feb 1, 2025

What version of Tailwind CSS are you using?

v3.4.17

What version of Node.js are you using?

v23.5.0

What operating system are you using?

macOS 15.2

Describe your issue

When using npx @tailwindcss/upgrade@next, if you have custom color/font overrides such as this:

module.exports = {
  theme: {
    extend: {
      colors: {
        flxBlue: '#19acff',
      }
    }
  }
}

The upgrade script will rename flxBlue to flx-blue, resulting in:

@import 'tailwindcss';

@plugin '@tailwindcss/container-queries';
@plugin 'tailwindcss-animate';

@theme {
  --color-flx-blue: #19acff;
}

Which seems OK, but existing usages are not updated (just an example diff showing the text-flxBlue not being modified):

@@ -9,7 +9,7 @@ interface ClaimPlaceCTAProps {

 export default function ClaimPlaceCTA({ place }: ClaimPlaceCTAProps) {
   return (
-    <div className="relative mt-8 w-full rounded-xl border border-zinc-200 bg-gradient-to-br from-white/95 to-zinc-50/95 p-8 text-center backdrop-blur-sm dark:border-zinc-800 dark:from-zinc-900/95 dark:to-zinc-9
50/95">
+    <div className="relative mt-8 w-full rounded-xl border border-zinc-200 bg-linear-to-br from-white/95 to-zinc-50/95 p-8 text-center backdrop-blur-xs dark:border-zinc-800 dark:from-zinc-900/95 dark:to-zinc-950
/95">
       <h3 className="font-renogare text-xl text-townWireBlue dark:text-flxBlue">
         Own this business?
       </h3>

Reproduction URL

Very simple demo repo here w/ Next.js on Tailwind v3: https://github.com/nicksergeant/tailwind-v4-upgrade-colors

The original color definition and usage:

And here is a branch showing the Tailwind v4 upgrade script (no other changes other than the automatic upgrade): https://github.com/nicksergeant/tailwind-v4-upgrade-colors/compare/ns/upgrade-to-v4

@nicksergeant nicksergeant changed the title [v4] Tailwind v4 upgrade script renames camelCase'd colors to versions with dashes, but does not update usages. [v4] Tailwind v4 upgrade script renames camelCase'd colors to kebab-case, but does not update usages. Feb 1, 2025
@nicksergeant nicksergeant changed the title [v4] Tailwind v4 upgrade script renames camelCase'd colors to kebab-case, but does not update usages. [v4] Tailwind v4 upgrade script renames camelCase'd colors/fonts to kebab-case, but does not update usages. Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant