Replies: 2 comments
-
|
Yes! shadcn/ui makes it easy to customize themes. Here are the main ways: 1. Use the Theme Customizer Visit https://ui.shadcn.com/themes and customize your theme visually. Then copy the CSS variables and paste them into your 2. Modify CSS Variables All theme colors are defined in @layer base {
:root {
--background: 0 0% 100%;
--foreground: 222.2 84% 4.9%;
--primary: 222.2 47.4% 11.2%;
/* ... customize these values */
}
.dark {
--background: 222.2 84% 4.9%;
--foreground: 210 40% 98%;
/* ... dark mode colors */
}
}3. Change the Base Color If you want to switch the entire color scheme, run: npx shadcn@latest initAnd select a different base color (slate, gray, zinc, neutral, stone). 4. Customize Individual Components Each component is in your codebase, so you can directly modify the styles in Quick Tips:
Hope this helps! |
Beta Was this translation helpful? Give feedback.
-
How to Modify Theme in shadcn/ui1. Change Color ThemeEdit @layer base {
:root {
--background: 0 0% 100%;
--foreground: 222.2 84% 4.9%;
--primary: 221.2 83.2% 53.3%; /* Change this for primary color */
--primary-foreground: 210 40% 98%;
/* ... other variables */
}
.dark {
--background: 222.2 84% 4.9%;
/* Dark mode colors */
}
}2. Use Theme GeneratorVisit: https://ui.shadcn.com/themes
3. Switch Style (Default ↔ New York)Edit {
"style": "new-york", // or "default"
"tailwind": {
"baseColor": "zinc" // slate, gray, zinc, neutral, stone
}
}Then reinstall components: npx shadcn@latest add button --overwrite4. Quick Theme SwitchFor easy switching, use the themes from the website:
This is the easiest way to change the entire look without deep CSS knowledge! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I used https://ui.shadcn.com/create to generate a basic template, and I developed on this basis later. However, I want to adjust the overall style now, such as changing the style. Do you have any good suggestions? It seems that switching styles and themes on the official website looks quite easy? I'm not a professional frontend developer, so I'm here to ask for some advice.
Beta Was this translation helpful? Give feedback.
All reactions