Skip to content

JS config colors get kebab-cased while CSS config colors don't #19336

@gabrielmfern

Description

@gabrielmfern

What version of Tailwind CSS are you using?

v4.1.17

What build tool (or framework if it abstracts the build tool) are you using?

Just the tailwindcss CLI

What version of Node.js are you using?

v25.1.0

What browser are you using?

N/A

What operating system are you using?

Linux

Reproduction URL

https://github.com/gabrielmfern/wrongly-kebab-cased-colors-with-js-config

Describe your issue

When defining camel cased colors through the CSS config, like so:

@theme {
  --color-camelCased: #ffffff;
}

Utilities with the camelCased color work just fine. text-camelCased, for example, becomes

@layer utilities {
  .text-camelCased {
    color: var(--color-camelCased);
  }
}

But when defining the same color though a JS config:

@config "./tailwind.config.js";
export default {
  theme: {
    colors: {
      camelCased: '#ffffff'
    }
  }
}

Only the kebab-cased version of the color's name works instead. So text-camel-cased, for example.

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