Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

444
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!