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

215
Visualizações
How can I have tailwind build multiple files based off variables passed in

So I have a very odd use case. I need two tailwind files built with the primary colour changed on each.

Here is an example.

const primaryTheme = {
    '50': '#fff3e0',
    '100': '#ffe0b2',
    '200': '#ffcc80',
    '300': '#ffb74d',
    '400': '#ffa726',
    '500': '#ff9800',
    '600': '#fb8c00',
    '700': '#f57c00',
    '800': '#ef6c00',
    '900': '#e65000',
};


module.exports = {

 ...

theme: {
  extend: {
    colors: {
        primary: primaryTheme,
}

...

so that would be one file and the other would swap the primaryTheme const for say this

primaryTheme = {
        '50': '#e6f5ea',
        '100': '#c2e7cb',
        '200': '#9bd7ab',
        '300': '#71c889',
        '400': '#4fbc70',
        '500': '#27b057',
        '600': '#1da14d',
        '700': '#0f8f41',
        '800': '#007e37',
        '900': '#005f23',
      }

so I'm trying to when I need to build for production, change the colour variables to a set of predefined colours.

So one build might generate two app.css files

app-blue.css
app-green.csss

for example with the primary theme variables changed.

Is there a way for me to automate this so I don't have to in and manually swap the const out for a different colour each time and then change the file names?

currently right now I'm building via npx but I could also with postcss


"scripts": {
    "dev": "npx tailwindcss -i ./wwwroot/css/tailwind.css -o ./wwwroot/css/app.css --watch",
    "build": "npx tailwindcss -i ./wwwroot/css/tailwind.css -o ./wwwroot/css/app.css --minify"
  },

I'm looking to only generate the multiple files on "build" if that makes it easier.

Thank you so much in advance for any hint or guidance :)

about 4 years ago · Juan Pablo Isaza
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