Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

102
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda