Skip to content

ThemeProvider Not Applying Styles in Vite Setup #5664

Answered by joshblack
luislufttech asked this question in Q&A
Discussion options

You must be logged in to vote

Hi there, @luislufttech! 👋 Sorry about the issues that you're running into when applying styles in Vite, I think this is pointing to a gap in our documentation as we're moving towards CSS Modules.

We have an example in the project that uses vite here: https://github.com/primer/react/tree/main/examples/codesandbox and I think you're spot on with the setup or ThemeProvider and BaseStyles and what is likely missing are imports to @primer/primitives so that the CSS Custom Properties are setup correctly.

This package exports each specific theme that can be imported, for example the following line will import the light theme:

import "@primer/primitives/dist/css/functional/themes/light.css";

Hop…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by joshblack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants