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

91
Visualizações
A way to output all possible css selectors for some html?

I often do my job by:

  1. Writing out all of the html based on the designs I'm sent.
  2. Writing out all of the empty css selectors for that html.
  3. Adding the styling to that css.

My question is can I automate the second part?

Is there any way of generating a <style> tag with every possible combination of css selectors for the html inside? I'm working in VSCode and any suggestions would be welcome. Example html below:

<div class="section1">
  <h1>heading</h1>
  <p>text​</p>
  <div class="gift-dropdowns">
    <div class="dropdown1">
      <span>text</span>
      <span class="arrow"></span>
      <div class="dropdown-content">
        <p>text</p>
        <p>text</p>
        <p>text</p>
      </div>
    </div>
    <div class="dropdown2">
      <span>text </span>
      <span class="arrow"></span>
      <div class="dropdown-content">
        <p>text</p>
        <p>text</p>      
      </div>
    </div>
  </div>
  <a class="cta-gift-header">text</a>
  <img src="" alt="" class="gift-star1">
  <img src="" alt="" class="gift-star2">
  <img src="" alt="" class="gift-star3">
</div>
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Generating every possible combination of css selectors wouldn't be very useful, but generating a list selectors for elements you wish to style would be helpful.

You can do this by giving each element you wish to style a class attribute, and using the eCSStractor extension for VSCode to generate a stylesheet with your classnames.

Also, if you aren't already using emmet I would highly recommend you start using it to generate your html structure more quickly. This makes assigning ids and classes much simpler.

about 4 years ago · Juan Pablo Isaza Relatório

0

No. It make no sense to create something that will generate all the combinations of styles, there could be only for this example over then 1000 style combinations. Why would you want to generate automatically the styles for all the elements? create style only for the elements that you need.

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