Chakra UI themes conflict in micro-frontend architecture (host + remote apps) #10324
Unanswered
riyajath-ahamed
asked this question in
Q&A
Replies: 1 comment 1 reply
-
The ideal solution here would be to put Let the remote expose its own theme, and you can figure out how to merge the remote's theme + host's theme in a deterministic manner. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I’m working on a micro-frontend application using Module Federation. Both the host and the remote module use Chakra UI, but each one has its own ChakraProvider and theme.
The issue I’m facing:
The host has its own theme.
The remote also has its own theme.
When both are loaded together, styles conflict (CSS variables override each other, global styles clash).
It looks like Chakra creates isolated theme contexts, but since both inject global styles, one ends up overriding the other.
What’s the recommended way to handle multiple Chakra themes in a micro-frontend setup?
Should I:
Let only the host provide a single
ChakraProvider
and theme, and make the remote consume it?Or, wrap each remote with its own
ChakraProvider
but useresetCSS={false}
to avoid global overrides?Or, is there another best practice (e.g., sharing the theme through federation)?
Beta Was this translation helpful? Give feedback.
All reactions