Skip to main content
RapidDev - Software Development Agency
bolt-ai-integrationsDesign-to-Code Bridge

How to Integrate Bolt.new with Tailwind CSS

Tailwind CSS is pre-installed and pre-configured in every Bolt.new project — you do not need to install it. Bolt uses Tailwind v3 with shadcn/ui components already set up. To customize Tailwind, modify the tailwind.config.js file by describing changes in the Bolt chat (custom colors, fonts, spacing, and breakpoints). The most common tasks are adding brand colors to the color palette, customizing the default font, and understanding the difference between Tailwind v3 (Bolt's default) and v4.

What you'll learn

  • Why Tailwind CSS is already installed in every Bolt.new project and what that means for your workflow
  • How to customize the Tailwind theme (brand colors, custom fonts, spacing, and breakpoints) through Bolt's chat
  • How to use shadcn/ui components (which come pre-included with Bolt) alongside custom Tailwind classes
  • How to avoid the most common Tailwind pitfalls in Bolt: class purging, arbitrary values, and the v3/v4 version difference
  • How to use Tailwind Merge for conditional class names in React components
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Beginner15 min read10 minutesDesignApril 2026RapidDev Engineering Team
TL;DR

Tailwind CSS is pre-installed and pre-configured in every Bolt.new project — you do not need to install it. Bolt uses Tailwind v3 with shadcn/ui components already set up. To customize Tailwind, modify the tailwind.config.js file by describing changes in the Bolt chat (custom colors, fonts, spacing, and breakpoints). The most common tasks are adding brand colors to the color palette, customizing the default font, and understanding the difference between Tailwind v3 (Bolt's default) and v4.

Tailwind CSS is Already in Your Bolt.new Project — Here's How to Customize It

Every Bolt.new project starts with Tailwind CSS v3 already installed, configured, and working. When you create a new Bolt project, the generated code uses Tailwind utility classes throughout — the layout, typography, colors, spacing, and responsive behavior are all powered by Tailwind from day one. You do not need to install anything, configure PostCSS, or run a build step to start using Tailwind. This is one of Bolt's most significant advantages for rapid prototyping: you can prompt Bolt to 'make the header background dark gray and the primary button blue' and the AI will apply the correct Tailwind classes immediately.

Bolt's default Tailwind setup includes several additions beyond bare Tailwind CSS. The shadcn/ui component library is pre-integrated — shadcn/ui provides professionally designed, accessible components (buttons, dialogs, dropdowns, forms, cards, and more) that are built on Radix UI primitives and styled with Tailwind. These components automatically pick up your custom Tailwind theme, so changing your primary color in tailwind.config.js updates all shadcn/ui components. The @tailwindcss/typography plugin (the 'prose' classes) is also included for styling rich text content.

The most important thing to know about Tailwind in Bolt: the default version is Tailwind v3, not v4. Tailwind v4 was released in early 2025 and introduces major breaking changes — a new CSS-first configuration format, a different plugin API, and different class name syntax for some utilities. If you or Bolt's AI generates code that uses v4 syntax (like the @import 'tailwindcss' pattern or the new configuration format), it will not work in Bolt's v3 setup without migration. This tutorial focuses entirely on Tailwind v3, which is what Bolt uses.

Integration method

Design-to-Code Bridge

Tailwind CSS is not an external integration — it is the default styling system built into every Bolt.new project. All Bolt projects are initialized with Tailwind v3, PostCSS, the shadcn/ui component library (which uses Tailwind), and the @tailwindcss/typography plugin. Customizing Tailwind in Bolt means modifying tailwind.config.js through Bolt's chat or Dev Mode editor. Understanding which Tailwind version Bolt uses (v3, not v4) and how to extend the theme are the key skills for customizing your Bolt app's visual design.

Prerequisites

  • A Bolt.new project (any new Bolt project already has Tailwind v3 installed — no setup required)
  • Basic familiarity with Tailwind CSS utility classes (bg-, text-, p-, m-, flex, grid, etc.)
  • Understanding that Bolt uses Tailwind v3, not v4 — v4 syntax will not work without migration
  • Optional: a brand color palette or design mockup in Figma to reference when prompting color customizations

Step-by-step guide

1

Understand What Tailwind v3 Gives You in Bolt by Default

When you create a new Bolt.new project, the project structure already includes everything you need for Tailwind: the tailwind CSS package installed in node_modules, a tailwind.config.js file in the project root with the content array pointing to your source files, a postcss.config.js file that enables Tailwind's PostCSS plugin, and the @tailwind base, @tailwind components, @tailwind utilities directives in your main CSS file (index.css for Vite projects, globals.css for Next.js). Bolt's default Tailwind config extends the base theme with shadcn/ui's color system — CSS custom properties (CSS variables) like --background, --foreground, --primary, --secondary, --muted, --accent, --destructive, and --ring are defined in the CSS file and mapped to Tailwind color utilities. This means shadcn/ui components automatically use your theme. The CSS variable approach is how shadcn/ui handles dark mode — you change the variable values in a .dark class selector and all components switch appearance. When you use Bolt's built-in dark mode toggle, it works through this CSS variable system. To see the current Tailwind configuration, use Bolt's Dev Mode (requires paid plan) to browse the file tree, or ask Bolt's chat: 'Show me my tailwind.config.js file'. Understanding this default setup prevents confusion when you add custom colors and they do not appear — the most common cause is putting custom colors in the wrong place in the config (they must go in theme.extend, not theme, to avoid overwriting the default palette).

tailwind.config.js
1// tailwind.config.js — default Bolt.new structure
2/** @type {import('tailwindcss').Config} */
3module.exports = {
4 darkMode: ['class'],
5 content: [
6 './pages/**/*.{ts,tsx}',
7 './components/**/*.{ts,tsx}',
8 './app/**/*.{ts,tsx}',
9 './src/**/*.{ts,tsx}',
10 ],
11 theme: {
12 container: {
13 center: true,
14 padding: '2rem',
15 screens: { '2xl': '1400px' },
16 },
17 extend: {
18 colors: {
19 // shadcn/ui CSS variable color system
20 border: 'hsl(var(--border))',
21 input: 'hsl(var(--input))',
22 ring: 'hsl(var(--ring))',
23 background: 'hsl(var(--background))',
24 foreground: 'hsl(var(--foreground))',
25 primary: {
26 DEFAULT: 'hsl(var(--primary))',
27 foreground: 'hsl(var(--primary-foreground))',
28 },
29 // ... other shadcn/ui color tokens
30 },
31 },
32 },
33 plugins: [require('@tailwindcss/typography'), require('tailwindcss-animate')],
34};

Pro tip: Always add custom colors inside theme.extend.colors, not directly in theme.colors. If you put colors in theme.colors, you replace the entire default palette (including shadcn/ui's color tokens) and break the component library. theme.extend.colors adds to the palette without overriding it.

Expected result: You understand the default Tailwind v3 configuration in your Bolt project and know where to add customizations safely.

2

Customize Your Brand Colors and Typography

The most impactful Tailwind customization is adding your brand colors so you can use them as Tailwind utility classes throughout your app. Open your tailwind.config.js (ask Bolt's chat to 'show me tailwind.config.js' or open it in Dev Mode) and add your brand colors inside theme.extend.colors. Use a color scale from 50 (lightest) to 950 (darkest) — tools like uicolors.app or palette generation tools can generate a full scale from a single brand color hex value. Once added, you can use bg-brand-500, text-brand-700, border-brand-200, etc. as Tailwind classes. For typography, add your preferred Google Font by including the font-face import in your CSS file and extending tailwind.config.js's fontFamily. Always use theme.extend for fontFamily to keep the default font stack as a fallback. The defaultTheme import from 'tailwindcss/defaultTheme' provides the default font stacks to spread after your custom font, ensuring a graceful fallback. For text sizes, heading weights, and line heights, you can override Tailwind's defaults in theme.extend.fontSize, theme.extend.fontWeight, and theme.extend.lineHeight. For consistent spacing that goes beyond Tailwind's default scale, add values in theme.extend.spacing using the numeric key equals pixel value convention (e.g., '18': '72px' gives you p-18, m-18, w-18, etc.). Ask Bolt's AI to make these changes — describe what you want in plain English and Bolt will update the config file correctly.

Bolt.new Prompt

Update tailwind.config.js to add my brand colors and font. In theme.extend.colors, add a 'brand' color palette with these hex values: { 50: '#f0f9ff', 100: '#e0f2fe', 200: '#b9e7fe', 300: '#7dd3fc', 400: '#38bdf8', 500: '#0ea5e9', 600: '#0284c7', 700: '#0369a1', 800: '#075985', 900: '#0c4a6e', 950: '#082f49' }. Also update the CSS variable --primary to use my brand-600 color value (0 132 199 in HSL format — or closest) so shadcn/ui buttons use my brand color. In the CSS file, add @import url for 'Inter' from Google Fonts and add it to theme.extend.fontFamily.sans.

Paste this in Bolt.new chat

tailwind.config.js
1// tailwind.config.js — with brand customization
2/** @type {import('tailwindcss').Config} */
3const defaultTheme = require('tailwindcss/defaultTheme');
4
5module.exports = {
6 darkMode: ['class'],
7 content: ['./src/**/*.{ts,tsx}', './index.html'],
8 theme: {
9 extend: {
10 colors: {
11 // Keep all shadcn/ui color tokens (do not replace theme.colors!)
12 border: 'hsl(var(--border))',
13 input: 'hsl(var(--input))',
14 ring: 'hsl(var(--ring))',
15 background: 'hsl(var(--background))',
16 foreground: 'hsl(var(--foreground))',
17 primary: {
18 DEFAULT: 'hsl(var(--primary))',
19 foreground: 'hsl(var(--primary-foreground))',
20 },
21 // Add brand colors
22 brand: {
23 50: '#f0f9ff',
24 100: '#e0f2fe',
25 200: '#b9e7fe',
26 300: '#7dd3fc',
27 400: '#38bdf8',
28 500: '#0ea5e9',
29 600: '#0284c7',
30 700: '#0369a1',
31 800: '#075985',
32 900: '#0c4a6e',
33 950: '#082f49',
34 },
35 },
36 fontFamily: {
37 sans: ['Inter', ...defaultTheme.fontFamily.sans],
38 },
39 },
40 },
41 plugins: [require('@tailwindcss/typography'), require('tailwindcss-animate')],
42};

Pro tip: After adding custom colors to tailwind.config.js, Vite's hot module replacement (HMR) in Bolt's preview usually picks up the changes automatically. If custom color classes are not being applied, try asking Bolt to restart the dev server, or add your new class names to the safelist in tailwind.config.js if they are generated dynamically.

Expected result: Brand colors are available as Tailwind utility classes (bg-brand-500, text-brand-700, etc.). The font changes to Inter throughout the app. shadcn/ui buttons and components reflect the updated primary color via the CSS variable.

3

Use Tailwind Merge for Conditional Classes in Components

As you build more complex components, you will encounter a common Tailwind problem: merging class names with conditional logic. For example, a Button component that accepts a variant prop ('primary', 'secondary', 'danger') needs to apply different Tailwind classes based on the variant. The naive approach — string concatenation or template literals — often results in duplicate or conflicting classes (e.g., 'p-4 p-2' where the last one wins but both are in the output). Tailwind Merge (the twMerge function from the tailwind-merge package) resolves class conflicts intelligently: it knows that p-4 and p-2 conflict on the same dimension and keeps only the last one. The cn() utility function — which is already included in Bolt's projects via shadcn/ui — combines clsx (for conditional class logic) and twMerge (for conflict resolution). Use cn() wherever you combine Tailwind classes with conditions. The cn() function is typically exported from a lib/utils.ts file in Bolt projects. Arbitrary value syntax (using square brackets like w-[137px] or mt-[calc(100vh-4rem)]) is a powerful Tailwind v3 feature for one-off values that do not fit the standard scale — use sparingly for layout calculations and pixel-perfect adjustments. Important Tailwind v3 vs v4 distinction: in v3, arbitrary values use standard square bracket syntax. In v4, some configurations moved to CSS files using @theme. If Bolt's AI generates v4-style configuration code (using @import 'tailwindcss' or @theme blocks), it will not work in Bolt's default v3 setup.

Bolt.new Prompt

Show me my lib/utils.ts file and verify it exports a cn() function that combines clsx and tailwind-merge. Then build a reusable Button component that uses cn() for variant-based class merging. The Button should accept a variant prop: 'primary' (bg-brand-600 text-white hover:bg-brand-700), 'secondary' (bg-gray-100 text-gray-900 hover:bg-gray-200), and 'danger' (bg-red-600 text-white hover:bg-red-700). Also accept a size prop: 'sm', 'md', 'lg'. Use cn() to merge the base classes, variant classes, and size classes without conflicts.

Paste this in Bolt.new chat

components/Button.tsx
1// lib/utils.ts — standard Bolt/shadcn/ui utility
2import { type ClassValue, clsx } from 'clsx';
3import { twMerge } from 'tailwind-merge';
4
5export function cn(...inputs: ClassValue[]) {
6 return twMerge(clsx(inputs));
7}
8
9// components/Button.tsx — using cn() for variant merging
10import { cn } from '@/lib/utils';
11import { ButtonHTMLAttributes, forwardRef } from 'react';
12
13interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
14 variant?: 'primary' | 'secondary' | 'danger';
15 size?: 'sm' | 'md' | 'lg';
16}
17
18const variantClasses = {
19 primary: 'bg-brand-600 text-white hover:bg-brand-700 focus:ring-brand-500',
20 secondary: 'bg-gray-100 text-gray-900 hover:bg-gray-200 focus:ring-gray-300',
21 danger: 'bg-red-600 text-white hover:bg-red-700 focus:ring-red-500',
22};
23
24const sizeClasses = {
25 sm: 'px-3 py-1.5 text-sm',
26 md: 'px-4 py-2 text-base',
27 lg: 'px-6 py-3 text-lg',
28};
29
30export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
31 ({ className, variant = 'primary', size = 'md', ...props }, ref) => (
32 <button
33 ref={ref}
34 className={cn(
35 'inline-flex items-center justify-center rounded-md font-medium',
36 'transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2',
37 'disabled:opacity-50 disabled:cursor-not-allowed',
38 variantClasses[variant],
39 sizeClasses[size],
40 className // Allow parent to override via className prop
41 )}
42 {...props}
43 />
44 )
45);
46
47Button.displayName = 'Button';

Pro tip: The className prop in your custom components should always be passed through cn() as the last argument so parent components can override styles when needed. This is the convention shadcn/ui uses and makes components composable — the parent's className overrides the component's defaults without conflicts.

Expected result: The cn() utility correctly merges Tailwind classes without conflicts. The Button component renders with the correct variant and size classes. Passing className from a parent overrides the default styles without creating duplicate conflicting classes.

4

Understand the Tailwind v3 vs v4 Difference and Common Gotchas

The single most confusing Tailwind issue in Bolt.new is the version difference: Bolt uses Tailwind v3, but Tailwind v4 was released in early 2025. Tailwind v4 is a major rewrite that changes how Tailwind is configured and used. In v4, configuration moves from tailwind.config.js to a CSS file using the @theme directive. In v4, plugins use a new JavaScript API. Some class name behaviors changed. The create-next-app default now scaffolds Tailwind v4, which means code snippets from Next.js tutorials or AI-generated code that references v4 patterns will not work in Bolt's v3 setup. The most common symptoms of v3/v4 confusion in Bolt: Bolt generates code using @import 'tailwindcss' in a CSS file (v4 syntax) and the styles do not apply; class names like text-balance or field-sizing-content appear (v4-specific utilities not in v3); or someone follows a Next.js 15 tutorial that installs Tailwind v4 and the tailwind.config.js format no longer works. If you encounter this, check package.json for the tailwindcss version. If it shows ^4.x, you have v4 and need to use v4's CSS-based config format. If it shows ^3.x, you have v3 and use tailwind.config.js. Another common gotcha: Tailwind's JIT (just-in-time) compiler purges classes not found in the content array. If you generate Tailwind class names dynamically in JavaScript (e.g., `bg-${color}-500`), the purger does not see the static class names and removes them. Add dynamically generated classes to the safelist in tailwind.config.js. Finally, Tailwind's @tailwindcss/typography prose classes apply sensible styling to arbitrary HTML — useful for blog content, documentation, or any HTML you do not control. Use prose, prose-lg, and dark:prose-invert in your layout components.

Bolt.new Prompt

Check my tailwind.config.js and package.json. Confirm I'm using Tailwind v3 (^3.x in package.json). If any class names I'm using are Tailwind v4-only, update them to v3 equivalents. Also add these classes to the safelist in tailwind.config.js since I generate them dynamically: ['bg-red-500', 'bg-green-500', 'bg-yellow-500', 'bg-blue-500', 'text-red-700', 'text-green-700', 'text-yellow-700', 'text-blue-700']. Show me the updated tailwind.config.js.

Paste this in Bolt.new chat

tailwind.config.js
1// tailwind.config.js — with safelist for dynamic classes
2/** @type {import('tailwindcss').Config} */
3module.exports = {
4 darkMode: ['class'],
5 content: [
6 './src/**/*.{js,ts,jsx,tsx}',
7 './pages/**/*.{js,ts,jsx,tsx}',
8 './components/**/*.{js,ts,jsx,tsx}',
9 './app/**/*.{js,ts,jsx,tsx}',
10 ],
11 safelist: [
12 // Dynamically generated status colors — must be safelisted
13 { pattern: /bg-(red|green|yellow|blue|brand)-(100|500|600)/ },
14 { pattern: /text-(red|green|yellow|blue|brand)-(700|800)/ },
15 { pattern: /border-(red|green|yellow|blue|brand)-(300|500)/ },
16 ],
17 theme: {
18 extend: {
19 // your custom extensions here
20 },
21 },
22 plugins: [
23 require('@tailwindcss/typography'),
24 require('tailwindcss-animate'),
25 ],
26};

Pro tip: When Bolt's AI generates a tailwind.config.js for you, check that the content array includes all the directories where your components live. Missing a directory means those files' classes get purged in production. For Vite projects: include './src/**/*.{ts,tsx}' and './index.html'. For Next.js: include './app/**/*.{ts,tsx}' and './components/**/*.{ts,tsx}'.

Expected result: Your project is confirmed on Tailwind v3. Dynamic class names are safelisted and will not be purged. The tailwind.config.js content array covers all component directories.

Common use cases

Apply Brand Colors to the Entire App

Extend Tailwind's color palette with your brand's primary and secondary colors so you can use them as Tailwind utility classes everywhere (bg-brand-500, text-brand-600, border-brand-300, etc.). Update tailwind.config.js once and every shadcn/ui component and custom class picks up the new colors.

Bolt.new Prompt

Update my app's color scheme to match my brand. Add these custom colors to tailwind.config.js under theme.extend.colors: brand: { 50: '#eff6ff', 100: '#dbeafe', 200: '#bfdbfe', 300: '#93c5fd', 400: '#60a5fa', 500: '#3b82f6', 600: '#2563eb', 700: '#1d4ed8', 800: '#1e40af', 900: '#1e3a8a' }. Also set the default primary color in the CSS variables (in index.css or globals.css) to my brand blue. Update all buttons to use bg-brand-600 hover:bg-brand-700 and all headings to use text-brand-800.

Copy this prompt to try it in Bolt.new

Add a Custom Font

Replace the default font with a Google Font (or local font) throughout the app. Load the font in the HTML head, add it to Tailwind's fontFamily configuration, and apply it as the default body font. Tailwind's font utilities (font-sans, font-serif, font-mono) will use your custom font.

Bolt.new Prompt

Add the Inter font to my app from Google Fonts. Load it in my HTML head (or in the CSS file with @import). Add Inter to tailwind.config.js under theme.extend.fontFamily as sans: ['Inter', ...defaultTheme.fontFamily.sans] so all text uses Inter by default. Apply font-sans to the root element in my layout. Also add the Fira Code font as my monospace font (theme.extend.fontFamily.mono) for code blocks.

Copy this prompt to try it in Bolt.new

Create a Consistent Design System with Custom Spacing

Extend Tailwind's spacing scale with custom values for consistent padding and margin throughout the app. Add custom breakpoints for specific design requirements. Create custom utility classes using Tailwind's @layer utilities for patterns you use repeatedly, like card containers or section wrappers.

Bolt.new Prompt

Extend my Tailwind config with a custom design system. Add custom spacing values: 18 (72px), 22 (88px), and 26 (104px) to the spacing scale. Add a custom breakpoint 'tablet' at 900px. Create a custom utility class .section-container using @layer utilities that applies max-w-6xl mx-auto px-4 sm:px-6 lg:px-8. Create a .card-elevated class with the standard card shadow and padding style I'll use throughout the app.

Copy this prompt to try it in Bolt.new

Troubleshooting

Custom Tailwind classes added to tailwind.config.js do not apply — the class has no visible effect

Cause: Custom colors or utilities were added to theme instead of theme.extend, overwriting the default palette including shadcn/ui's CSS variable color tokens. Or the tailwind.config.js content array is missing the directory where the component using the class lives.

Solution: Always use theme.extend.colors for custom colors, not theme.colors. Check the content array in tailwind.config.js includes the path to the file using the class. Restart the dev server in Bolt after config changes.

typescript
1// CORRECT — use theme.extend to add without overwriting
2theme: {
3 extend: {
4 colors: { brand: { 500: '#0ea5e9' } }
5 }
6}
7
8// WRONG — this replaces the entire color palette
9theme: {
10 colors: { brand: { 500: '#0ea5e9' } }
11}

Tailwind classes work in the Bolt preview but disappear after deploying to Netlify

Cause: Classes generated dynamically in JavaScript (e.g., template literals like `bg-${status}-500`) are not detected by Tailwind's content scanner during the production build and are purged.

Solution: Add dynamically generated class patterns to the safelist array in tailwind.config.js. Use the pattern property with a regex to match all variants of the dynamically generated class.

typescript
1// In tailwind.config.js:
2safelist: [
3 { pattern: /bg-(red|green|yellow|blue)-(100|500|600)/ },
4 { pattern: /text-(red|green|yellow|blue)-(700|800)/ },
5]

Bolt AI generates code using @import 'tailwindcss' in CSS or @theme blocks — styles do not apply

Cause: The AI generated Tailwind v4 syntax. Bolt uses Tailwind v3, which uses tailwind.config.js and @tailwind base/components/utilities directives — not the new CSS-first v4 configuration format.

Solution: Ask Bolt to revert to Tailwind v3 configuration format. Replace any @import 'tailwindcss' with the v3 directives: @tailwind base; @tailwind components; @tailwind utilities; Move any configuration from CSS @theme blocks back to tailwind.config.js under theme.extend.

typescript
1/* index.css or globals.css — correct Tailwind v3 format */
2@tailwind base;
3@tailwind components;
4@tailwind utilities;
5
6/* Tailwind v4 syntax (DO NOT USE in Bolt) — remove if present: */
7/* @import 'tailwindcss'; */
8/* @theme { --color-brand: #0ea5e9; } */

Best practices

  • Always add custom colors to theme.extend.colors, never to theme.colors — replacing theme.colors breaks shadcn/ui's CSS variable color system
  • Use the cn() utility from lib/utils.ts for all conditional Tailwind class merging — it handles both boolean conditions (clsx) and class conflicts (tailwind-merge) correctly
  • Bolt uses Tailwind v3 — if you see @import 'tailwindcss' or @theme in generated CSS, that is v4 syntax and will not work without migration
  • Add dynamically generated class names (from template literals like `bg-${color}-500`) to the tailwind.config.js safelist so they are not purged in production builds
  • Use Tailwind's arbitrary value syntax (w-[137px], mt-[calc(100vh-4rem)]) sparingly for one-off layout values that do not belong in the theme — they work in Bolt's Tailwind v3 setup
  • The @tailwindcss/typography prose classes handle arbitrary HTML content beautifully — use prose and dark:prose-invert for blog content, documentation, and rich text areas
  • When using dark mode, update both the light and dark CSS variable values in index.css — shadcn/ui's dark mode works by swapping CSS variable values in the .dark class selector, not by toggling Tailwind's dark: prefix on individual elements

Alternatives

Frequently asked questions

Do I need to install Tailwind CSS in Bolt.new?

No. Tailwind CSS v3 is pre-installed and configured in every new Bolt.new project. The tailwind.config.js, postcss.config.js, and CSS directives are all set up automatically. You can start using Tailwind utility classes immediately without any installation steps.

Which version of Tailwind CSS does Bolt.new use?

Bolt.new uses Tailwind CSS v3. Tailwind v4 was released in early 2025 with breaking changes — a new CSS-based configuration format and different plugin API. If Bolt's AI generates v4-style code (using @import 'tailwindcss' or @theme blocks in CSS), it will not work in Bolt's v3 setup. Check package.json to confirm your version.

How do I add custom brand colors to my Bolt.new app?

Ask Bolt's chat to add your brand colors to tailwind.config.js under theme.extend.colors — always use theme.extend, not theme, to avoid overwriting the default palette. Describe your brand hex values and preferred color names. After updating the config, Bolt's dev server will hot-reload and your new color utilities (bg-brand-500, text-brand-700, etc.) will be immediately available.

What is the cn() function in Bolt.new projects?

The cn() function is a utility exported from lib/utils.ts that combines clsx (for conditional class logic) and tailwind-merge (for resolving Tailwind class conflicts). Use cn() whenever you combine Tailwind classes with conditions — for example, cn('base-class', isActive && 'active-class', className). It correctly resolves conflicts like p-4 and p-2 appearing together by keeping only the last value.

Why are my dynamic Tailwind classes not showing up in production?

Tailwind's JIT compiler scans your source files for class names and removes unused ones in the production build. Classes generated dynamically with JavaScript template literals (e.g., `bg-${color}-500`) are not visible to the scanner and get purged. Add dynamically generated classes to the safelist array in tailwind.config.js using a regex pattern, such as { pattern: /bg-(red|green|blue)-500/ }.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Need help with your project?

Our experts have built 600+ apps and can accelerate your development. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.