Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1K
Views
Tailwind class is not working after installed

I try to use CSS, im just install the tailwindcss with npm, and then i build the css and provide the output.css. But, when i use the bg-black class in button for testing, it's still not working.

build command that i use tailwindcss -i ./src/style.css -o ./dist/output.css i put it into script in package.json

Directory file path:
enter image description here

in src/style.css

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

in tailwind.config.js

    theme: {
      extend: {
        // ...
      },
    },
    plugins: [],
  }

in dist/index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="output.css">
    <title>Learn Tailwind</title>
</head>
<body>
    <div class="container">
        <button class="bg-black">Awesome</button>
    </div>
</body>
</html>

The HTML in browser result:

enter image description here

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

I see you import "output.css" in your code but you necessarily need to import your tailwind css file. Ex:

<link rel="stylesheet" href="src/style.css">

See doc: https://tailwindcss.com/docs/installation

over 4 years ago · Santiago Trujillo Report

0

I had the same issue. it is to do with your tailwind.config.js Make sure you have the content list pointing to your html files that are using tailwind. (see code below to look at all files with html at one level down)

Then run the command:

npx tailwindcss -i ./src/input.css -o ./dist/output.css --watch

Ensure you don't get any warning messages about invalid paths.

module.exports = {
  content: ['./*/*.html', ],
  theme: {
    extend: {},
  },
  plugins: [],
}
over 4 years ago · Santiago Trujillo Report

0

I see you are using build command and put it in your package.json, that is right. But did you run npm run build then?

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!