Skip to content

[v4] [vite] Internal server error: Could not resolve value for theme function: theme(...) #15366

Closed Answered by philipp-spiess
richardgorman asked this question in Help
Discussion options

You must be logged in to vote

Hey! We recently added a new feature to make this use case simpler: #15228

However, you'll still need to import a theme into each CSS root file that uses Tailwind features as there's no more global per-project JavaScript configuration file. If you're using something like CSS modules, there's going to be a lot of CSS roots that are independent of each other. We mentioned this in the docs in regards to Svelte/Vue setups which share a similar setup with different CSS files per component: https://tailwindcss.com/docs/v4-beta#using-apply-in-vue-svelte

One thing to note in v4 though is that you can just use CSS variables from your root CSS file and won't have to use the theme() function except …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by richardgorman
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants