Skip to content

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

Closed
@nicksergeant

Description

@nicksergeant

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions