src/app/globals.css.
Color Palette
The project uses a CSS variable-based color system, inspired by shadcn/ui. This makes it easy to apply your own brand colors across all components.1
Understand the Color Variables
Open
src/app/globals.css. You’ll find two main color blocks: :root for the light theme and .dark for the dark theme.Key variables to change are:--background: The main page background color.--foreground: The main text color.--primary: The primary color for interactive elements like buttons.--primary-foreground: The text color used on top of primary elements.--secondary: A secondary color for less prominent elements.--accent: A color for highlighted or active elements.--destructive: A color for dangerous actions, like delete buttons.--border: The color for borders and dividers.
src/app/globals.css
The colors are defined using
oklch(), a modern CSS color function that allows for intuitive adjustments. You can use online tools like Oklch Color Converter to find the oklch values for your brand’s hex codes.Alternatively, you can use standard hex codes directly. The following examples will use hex codes for simplicity.2
Change the Primary Color
While the boilerplate uses
oklch() for its benefits in theme modification, you can simply use standard hex codes.Let’s say your brand’s primary color is a blue, like #3b82f6. You can update the --primary variable directly with this value. Remember to also choose a readable foreground color (like #ffffff for white).src/app/globals.css
3
See Your Changes Apply Globally
The true power of this system is its global reach. A single change to a color variable in This means when you use the
globals.css cascades throughout your entire application, ensuring brand consistency.This works because components are built using Tailwind’s utility classes (like bg-primary), which are linked to your color variables.Let’s look at the <Button> component as a specific example. Inside src/components/ui/button.tsx, you can see its default style is defined using bg-primary:src/components/ui/button.tsx
<Button>, it automatically reflects your changes.Your new brand colors will be reflected not just on buttons, but consistently across many other components like toggles, badges, and input fields.
Typography
Fonts are managed usingnext/font for optimal performance. The default fonts are Geist Sans and Geist Mono.
1
Find the Font Configuration
Font settings are located in
src/app/layout.tsx.src/app/layout.tsx
2
Update the Font
To change the font, simply import a new one from
next/font/google and assign it to the --font-geist-sans variable.src/app/layout.tsx
Why does this work? Understanding the Font System
Why does this work? Understanding the Font System
The system is built on a three-step connection. By reassigning the
--font-geist-sans variable, you only change the “source” font, and the rest updates automatically.- Tailwind Class (
font-sans): Applied in your.tsxcomponents. - CSS Variable (
--font-geist-sans): Acts as a bridge, linked tofont-sansinglobals.css. - Font File (e.g.,
Inter): The actual font assigned to the variable inlayout.tsx. This is the only part you change.