Closed heymartinadams closed 1 year ago
Tailwind CSS can't see a classname like theme_${foo}_${bar}
. If you replace that with something hardcoded it should work. You can also consider applying the class that sets the theme on <body>
or <html>
so it'll scope the portals as well. If I'm still missing a reproduction where I can see more code can help.
I figured it out by adding this class via a useEffect
:
useEffect(() => {
document.body.classList.add(`theme_${appTheme?.brand}_${appTheme?.tint}`)
}, [appTheme])
Many thanks ✨
Hi there ☺️
For some reason,
tailwindcss-theme-swapper
doesn’t seem to be applying the theme on popovers that are created programmatically (for example, a datetime picker popover).In the DOM, the popover creates a new component that lives outside NextJS’
<div id="_next">
.Even if I wrap the component in my theme...
...it doesn’t apply to the popover.
How can this be fixed?