-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
What version of Tailwind CSS are you using?
v4.0.17
What build tool (or framework if it abstracts the build tool) are you using?
Vite 6.2.0
What version of Node.js are you using?
v22.13.1
What browser are you using?
Chrome
What operating system are you using?
macOS
https://github.com/mirorauhala/tw-custom-properties
Issue
Referencing colors as --color-*
properties from a CSS module file does not work unless the color utility is mentioned elsewhere.
For example, if you define a color such as --color-red-custom-1: red
and use it from a CSS module file, like this:
.red { background: var(--color-red-custom-1); }
The final build will not contain the custom property defined and the color won't show correctly unless bg-red-custom-1
is used elsewhere, which will cause the property to be included in the build.
Expected
The colors to work. The docs outline the following:
Colors are exposed as CSS variables in the --color-* namespace, so you can reference them in CSS with variables like --color-blue-500 and --color-pink-700: