Skip to content

[v4.0.9+] Variables are ignored when referenced within CSS Modules #16904

Closed
@boylett

Description

@boylett

What version of Tailwind CSS are you using?

For example: v4.0.9

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?

22.0.0

What browser are you using?

Chrome, Safari and Firefox

What operating system are you using?

macOS and Windows

Reproduction URL

https://github.com/boylett/tailwind-4-0-9-cssmodule-var-bug

Describe your issue

When referencing the main theme file within CSS Modules, variables are no longer recognised and exported in the main CSS.

This works fine in 4.0.8 (see 'working' branch) so am inclined to believe it has something to do with the new @reference keyword.

Within reproduction, the background colour of the main "Welcome" component wrapper should be --color-hot-pink rather than transparent.

On the 'main' branch, tw 4.0.9, the variable is simply ignored and not included in the final CSS.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions