Lovable ui

Tailwind CSS Classes Not Applying or Conflicting

Tailwind classes are written correctly but styles don't apply to elements. Custom CSS conflicts with Tailwind. Class purging removes needed styles or adds unwanted ones.

Tailwind requires proper configuration of content paths for class scanning. Conflicts occur when CSS specificity issues override Tailwind utilities.

Common Causes

  1. tailwind.config.js content paths don't include component files
  2. Using arbitrary class names outside content scope
  3. CSS !important declarations overriding Tailwind utilities
  4. Tailwind CSS not imported in main.css
  5. Template files not scanned due to wrong file extension

How to Fix It

Verify tailwind.config.js includes all template files:

export default {
  content: [
    './index.html',
    './src/**/*.{js,jsx,ts,tsx}'
  ]
}

Import in main.css:

@tailwind base;
@tailwind components;
@tailwind utilities;

Avoid !important in custom CSS that conflicts with utilities.

Real developers can help you.

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 Costea Adrian Costea Adrian Embedded Engineer specilizing in perception systems. Latest project was a adas camera calibration system. Bastien Labelle Bastien Labelle Full stack dev w/ 20+ years of experience MFox MFox Full-stack professional senior engineer (15+years). Extensive experience in software development, qa, and IP networking. BurnHavoc BurnHavoc Been around fixing other peoples code for 20 years. prajwalfullstack prajwalfullstack Hi Im a full stack developer, a vibe coded MVP to Market ready product, I'm here to help Rudra Bhikadiya Rudra Bhikadiya I build and fix web apps across Next.js, Node.js, and DBs. Comfortable jumping into messy code, broken APIs, and mysterious bugs. If your project works in theory but not in reality, I help close that gap. Stanislav Prigodich Stanislav Prigodich 15+ years building iOS and web apps at startups and enterprise companies. I want to use that experience to help builders ship real products - when something breaks, I'm here to fix it. rayush33 rayush33 JavaScript (React.js, React Native, Node.js) Developer with demonstrated industry experience of 4+ years, actively looking for opportunities to hone my skills as well as help small-scale business owners with solutions to technical problems 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.

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 are Tailwind classes stripped in production?

Classes not in content paths are purged. Ensure all component files are in tailwind.config.js content array.

How do I use arbitrary values in Tailwind?

Use bracket notation: w-[500px], gap-[3px]. These must be in content files or template strings won't work in production.

Related Lovable 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