Bolt ui

Tailwind CSS Classes Not Applying - Styles Ignored

Tailwind CSS classes aren't being applied to elements. You add classes like 'bg-blue-500' but the element stays unstyled.

Sometimes works in some components but not others. Manual styles work fine.

Error Messages You Might See

Tailwind CSS not found Styles not applying Class text-blue-500 not recognized PostCSS plugin error
Tailwind CSS not foundStyles not applyingClass text-blue-500 not recognizedPostCSS plugin error

Common Causes

  1. Tailwind not configured in tailwind.config.js or config missing CSS input path
  2. CSS file not imported in main layout or root component
  3. Dynamic class names (string templates) not scanned by Tailwind content config
  4. CSS Autoprefixer or PostCSS not configured properly
  5. Purged classes - content config doesn't include template files with classes

How to Fix It

Verify tailwind.config.js content includes all template paths: content: ['./src/**/*.{js,jsx,ts,tsx}']

Ensure CSS imported in root: import 'tailwindcss/tailwind.css'

Avoid dynamic class names: const className = `text-${color}` won't work. Use full class names or Tailwind merge utility

Check PostCSS config has Tailwind plugin

Rebuild after config changes: npm run dev

Real developers can help you.

Matthew Butler Matthew Butler Systems Development Engineer @ Amazon Web Services Costea Adrian Costea Adrian Embedded Engineer specilizing in perception systems. Latest project was a adas camera calibration system. Prakash Prajapati Prakash Prajapati I’m a Senior Python Developer specializing in building secure, scalable, and highly available systems. I work primarily with Python, Django, FastAPI, Docker, PostgreSQL, and modern AI tooling such as PydanticAI, focusing on clean architecture, strong design principles, and reliable DevOps practices. I enjoy solving complex engineering problems and designing systems that are maintainable, resilient, and built to scale. legrab legrab I'll fill this later Yovel Cohen Yovel Cohen I got a lot of experience in building Long-horizon AI Agents in production, Backend apps that scale to millions of users and frontend knowledge as well. MFox MFox Full-stack professional senior engineer (15+years). Extensive experience in software development, qa, and IP networking. Jared Hasson Jared Hasson Full time lead founding dev at a cyber security saas startup, with 10 yoe and a bachelor's in CS. Building & debugging software products is what I've spent my time on for forever Matt Butler Matt Butler Software Engineer @ AWS Omar Faruk Omar Faruk As a Product Engineer at Klasio, I contributed to end-to-end product development, focusing on scalability, performance, and user experience. My work spanned building and refining core features, developing dynamic website templates, integrating secure and reliable payment gateways, and optimizing the overall system architecture. I played a key role in creating a scalable and maintainable platform to support educators and learners globally. I'm enthusiastic about embracing new challenges and making meaningful contributions. prajwalfullstack prajwalfullstack Hi Im a full stack developer, a vibe coded MVP to Market ready product, I'm here to help

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help

Frequently Asked Questions

Why don't dynamic Tailwind classes work?

Tailwind uses static analysis. text-${color} is a template and Tailwind can't scan it. Use full class names or mapping

How do I use arbitrary values instead?

Use bracket syntax: bg-[#1234567] for custom colors, or configure in tailwind.config.js

Should I use CSS modules with Tailwind?

Tailwind works best without CSS modules. Use utility-first directly in JSX

Related Bolt Issues

Can't fix it yourself?
Real developers can help.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help