Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

100
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda