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

92
Visualizações
Trying to understand how some css is being used in the application via Postcss and cssnext

I'm a newbie developer taking a look at an application and I'm a bit puzzled but want to understand how some css is working. I've done some reading and research but my knowledge around how it's built is limited:

1 - The app contains a file e.g. style1.js which has some code such as

module.exports = {
   primary: 'red'
}

2 - There is then another style file for a component e.g. header.css which has

.header {
   color: var(--primary);
}

With some research I've learned that there is a tool called Postcss which is being used here which lets the primary variable be replaced with the value from the js file. However I don't see the file style1.js being imported in either the component or in this style file, so not sure how it gets access to the 'primary' variable.

3 - When the app is built and run and I inspect the source, I see a few styles for the page and when I inspect the bundle.js file I see in various sections all the other styles in here, they're laid out in this way:

eval("module.exports = ....lots of other code and styles
    primary: 'red'
);

I'd like to know how these styles might be ending up here in this way and then how they're being applied to elements on the page, as they're not in a stylesheet or in the style tags at the top of the page which I know Webpack can do.

Any information to help connect the dots here would be great. The app is being built through Webpack.

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