Tailwind CSS Theme Configuration
Configure Tailwind CSS v4 and Shadcn UI themes in your Next.js Prisma 7 SaaS kit application.
Configure your color palette and component styling using Tailwind CSS v4 and Shadcn UI themes - all through CSS variables without modifying components.
The Next.js Prisma 7 SaaS kit uses Tailwind CSS v4 with Shadcn UI for all styling. Theme customization happens entirely through CSS variables defined in the styles/ directory. You can apply pre-built Shadcn UI themes with a single import or define custom colors using the standard variable naming convention. All Shadcn UI components automatically inherit your theme.
The Tailwind CSS theme in this kit is a set of CSS custom properties (variables) that control colors, radii, and spacing across all Shadcn UI components. Changing these variables updates the entire UI.
CSS File Structure
| File | Purpose | Edit? |
|---|---|---|
globals.css | Main entry point, imports other files | Rarely |
theme.css | Tailwind v4 theme tokens | Rarely |
shadcn-ui.css | Shadcn UI CSS variables | Rarely |
custom.css | Your customizations go here | Yes |
makerkit.css | Kit-specific styles | Rarely |
markdoc.css | Documentation content styles | Rarely |
Applying a Shadcn UI Theme
Copy CSS variables from the Shadcn UI themes page into your custom.css:
Step 1: Choose a Theme
Go to the Shadcn UI Themes page, select a theme, and click "Copy".
Step 2: Paste into custom.css
Edit apps/web/styles/custom.css and paste the copied CSS:
/* * custom.css * Add your custom styles here */@layer base { :root { --background: 0 0% 100%; --foreground: 240 10% 3.9%; --card: 0 0% 100%; --card-foreground: 240 10% 3.9%; --popover: 0 0% 100%; --popover-foreground: 240 10% 3.9%; --primary: 240 5.9% 10%; --primary-foreground: 0 0% 98%; /* ... all other variables from the theme */ } .dark { --background: 240 10% 3.9%; --foreground: 0 0% 98%; /* ... dark mode variables */ }}Step 3: Restart the Dev Server
Tailwind CSS v4 may require a restart to pick up CSS changes:
pnpm devAfter restart, verify your theme applied by checking any button or link - they should show your new primary color. If colors don't update, hard refresh with Cmd+Shift+R (Mac) or Ctrl+Shift+R (Windows).
Defining Custom Colors
To use your own brand colors, define CSS variables in custom.css:
@layer base { :root { --background: 0 0% 100%; --foreground: 222.2 84% 4.9%; --primary: 221.2 83.2% 53.3%; --primary-foreground: 210 40% 98%; /* Add all required variables */ } .dark { --background: 222.2 84% 4.9%; --foreground: 210 40% 98%; --primary: 217.2 91.2% 59.8%; --primary-foreground: 222.2 47.4% 11.2%; }}Colors use HSL format without the hsl() wrapper: hue saturation% lightness%.
Required CSS Variables
Shadcn UI expects these variables to be defined:
| Variable | Purpose |
|---|---|
--background | Page background |
--foreground | Default text color |
--primary | Primary brand color |
--primary-foreground | Text on primary color |
--secondary | Secondary color |
--muted | Muted backgrounds |
--accent | Accent highlights |
--destructive | Error/danger color |
--border | Border color |
--ring | Focus ring color |
--radius | Border radius |
See the Shadcn UI theming docs for the complete list.
Common Pitfalls
- Editing
shadcn-ui.cssinstead ofcustom.css: Your changes may be overwritten. Always usecustom.cssfor customizations. - Wrong HSL format: Use
221.2 83.2% 53.3%nothsl(221.2, 83.2%, 53.3%). Thehsl()wrapper is added by Tailwind. - Mismatched theme class: The
shadcnUiStylevariable must exactly match the theme file name (e.g.,style-novanotnova). - Forgetting dark mode: Always define both
:root(light) and.dark(dark) variants for each variable. - Not restarting dev server: Tailwind v4 CSS changes may require a restart to take effect.
Frequently Asked Questions
How do I preview theme changes without restarting?
Can I mix multiple themes?
How do I add custom Tailwind utilities?
Does the theme affect email templates?
Related
- Branding Overview - Full branding customization guide
- Logo Configuration - Application logo and favicons
- Font Configuration - Typography customization
Next: Logo →