Global CSS Setup
The global CSS file is located atstyles/globals.css
. This file contains the base styles and CSS variables for theming.
Customizing CSS Variables
You can customize the theme by modifying the CSS variables. ShadcnKit uses a set of predefined variables for colors, spacing, and other design tokens. Here’s an example of customized CSS variables:- Open
styles/globals.css
- Replace the existing
:root
and.dark
sections with your custom CSS variables
Theme Provider
ShadcnKit uses Next.js’ built-in theme support through thenext-themes
package. The theme provider is set up in app/theme-provider.tsx
:
app/layout.tsx
) to enable theme switching:
Customizing Themes
To create custom themes or modify existing ones:- Use the Shadcn UI Theme Generator to generate your desired color scheme.
- Copy the generated CSS variables.
- Paste them into your
styles/globals.css
file, replacing or modifying the existing:root
and.dark
sections.
Using Themes in Components
With the theme set up, you can use the theme variables in your components:Switching Themes
ShadcnKit provides a theme toggle component out of the box.Best Practices
- Use Tailwind classes for most styling needs.
- Utilize the predefined CSS variables for consistent theming.
- Use the
dark:
variant in Tailwind classes for dark mode specific styles.