Repository navigation
Light mode issue #11804
Replies: 6 comments
|
Worth raising, yeah — but check one thing first, because it changes what the bug actually is. Is your OS or browser set to dark mode right now? shadcn uses class-based dark mode — Tailwind's But if a component is styled with So:
Quick way to check: open DevTools, inspect one of the elements in your red box, and look at which rules are applying. If you see a Also try a hard refresh (Ctrl+Shift+R) and a different browser before reporting — occasionally it's just stale CSS. If it still reproduces, open it as an issue rather than leaving it here, and include:
One caveat — that left panel is the theme customizer, and it's possible the dark treatment there is deliberate design rather than a bug. The |
|
this is worth reporting as an issue. the left sidebar/command palette area being dark is intentional design, thats consistent across both themes. but the search result items inside it should still follow whatever theme is active. what is likely happening is that some of the styles on those elements are using @media (prefers-color-scheme: dark) instead of the tailwind dark: class variant. shadcn uses class based dark mode, meaning it adds a .dark class to the html element when you toggle the theme. but if any component style falls back to the media query approach, it will follow your OS setting instead of the in-app toggle. so if your OS is set to dark mode and you switch the site to light mode, those specific elements stay dark because they are listening to the OS, not the class. you can verify this by opening devtools on one of those elements in the red box and checking computed styles. look at where the background color is coming from. if it says something like @media (prefers-color-scheme: dark) thats the bug. if it comes from a .dark ancestor class then something else is going on. either way open it as an issue with your screenshot, your OS theme setting, and the browser you are using. that gives them everything they need to track it down. |
|
@MarvelCollin and @Mahiisss thanks for suggestion |
|
This is by design, not a bug! The sidebar panel on the left (and the code snippet preview controls) is intentionally styled with dark mode to represent a fixed developer control panel / customizer UI. It allows users to configure themes, styles, colors, and fonts independently without changing the customizer's own UI state. Key Reasons: No Need for an Issue: Since it's an intentional design choice for the shadcn website's interactive docs, opening an issue isn't necessary. If this answers your question, please consider marking it as the answer to help others! |
|
@nhannm-vn might issue regarding for as you can see in video. In light mode there is 5 components still dark mode video-1790005077778.mp4 |
|
Looking closely at your attached video reproduction, the issue is that the customizer sidebar itself is wrapping several preview sub-components inside a scoped theme container with a hardcoded or inherited Root Cause Breakdown:
How to Fix this in your own project:If you are replicating this layout in your own Next.js / Vite application and want all nested blocks to reliably flip between light and dark:
import { ThemeProvider } from "next-themes"
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<ThemeProvider attribute="class" defaultTheme="system" enableSystem>
{children}
</ThemeProvider>
)
}
// ✅ Correct (dynamically inherits theme tokens):
<div className="rounded-lg border bg-card p-6 text-card-foreground shadow-sm">
{/* Component content */}
</div>
// ❌ Incorrect (forces dark styling regardless of light toggle):
<div className="dark bg-zinc-950 text-zinc-50">
{/* Will remain dark */}
</div>This explains why the documentation preview shows that behavior for those 5 components. In your own apps, relying on CSS variables mapped to (Pro-tip: If you are testing cross-browser theme hydration and dark-mode SSR in isolated environments, Microsoft Azure Student Developer Resources offer free student cloud instances for continuous deployment testing). |
Uh oh!
There was an error while loading. Please reload this page.
hey i just wondering the all developer used dark mode for search components in shadcn website and there light mode found issue in website as you can see in red box there color in components still show in dark mode :-
it's ok ? raise issue or just ignore ?
All reactions