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

446
Visualizações
Import scss file dynamically in vue js

i am working on a Vuejs project and, I would like to import ".scss" files dynamicly during script. for example I would like to import "assets/sass/style.scss" in the style tag without writing any codes in the style tag. I would like to handle it in the script section.

check below codes:

<style  lang="scss">
  @import "assets/sass/plugins";
  @import "assets/sass/style";

  //@import "assets/sass/plugins.dark";
  //@import "assets/sass/style.dark";
</style>

This styles are retaled to dark mode and light mode. sometimes i need to use light and sometimes dark and i can not use both at the same time. so need wtite script to do this.

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Try to wrap CSS imports in a class:

<style lang="scss">
  .light {
    @import "assets/sass/plugins";
    @import "assets/sass/style";
  }
  .dark {
    @import "assets/sass/plugins.dark";
    @import "assets/sass/style.dark";
  }
</style>

And then use class binding for that class:

<div :class="isDark ? 'dark': 'light'">
    ...
</div>
about 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