0

I have created my project with vue-cli and I have loaded css files using require in my main.js file.

I need to load different css files if user decides to see website in RTL languages (like displaying another theme).

I have searched and read about style-loader, css-loader and vue style-loader, but it all seems vague to me.

Nima Ajdari
  • 2,754
  • 2
  • 14
  • 18
  • Can't you use [conditional rendering](https://vuejs.org/v2/guide/conditional.html)? – Julien Rousé Dec 20 '17 at 13:02
  • @JulienRousé I dont need different templates, only different styles – Nima Ajdari Dec 22 '17 at 12:02
  • 1
    Different approach, but if you had different class name for RTL and non-RTL in your css you might be able to trigger the right css style? Of course you need to load both style everytime which isn't perfect – Julien Rousé Dec 22 '17 at 13:23
  • That's what I already had in mind. If a better solution is not found I would go for it! – Nima Ajdari Dec 23 '17 at 07:32
  • weird how I still can't find a good answer on how to do this. how to get the loaders to do stuff conditionally? – Madd0g Oct 02 '18 at 07:27

0 Answers0