How to scope shadcn/ui to only /dashboard
directory while keeping generic brand theme in root?
#7637
Unanswered
sachithrrra
asked this question in
Q&A
Replies: 1 comment
-
Wrap your dashboard in a div with a custom class, and try to apply light or dark to that div, not the whole page. Set ThemeProvider to use class. Put all your Shadcn CSS vars inside .dashboard-scope.light and .dashboard-scope.dark. That should keep themes and styles locked to dashboard only |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
I'm trying to use shadcn/ui components only in my
/dashboard
directory while maintaining a generic brand theme in the root of my application. I also need dark/light theme support specifically for the dashboard area only. I want to avoid shadcn styles bleeding into the rest of my app.What I've tried
Scoped CSS Variables** ❌ (Didn't work)
I tried creating separate CSS variable scopes:
Root styles (
globals.css
):Dashboard styles (
/dashboard/dashboard.css
):Dashboard layout with ThemeProvider:
Issues:
Project Structure
What I need
Environment
Any help would be greatly appreciated! 🙏
Beta Was this translation helpful? Give feedback.
All reactions