DEV Community

Discussion on: My SCSS setup within a Vue CLI 3 project

 
peoray profile image
Emmanuel Raymond • Edited

Hey Allan and Lynne, Sorry, kinda lost here :) Can you explain what you did to solve this? Especially with the import.scss file

Although, I think maybe importing the global.scss file in App.vue might also be a good solution?

Thread Thread
 
lynnewritescode profile image
Lynne Finnigan

Hi Emmanuel, the import.scss file should just have things like variables and mixins that the other files will need access to. If you don't use the plugin to serve the variables etc, you can't access them and use them within other components.

Thread Thread
 
peoray profile image
Emmanuel Raymond

So basically, from your example. Everything imported in the global.scss file is available to use in all the components?

Thread Thread
 
seanrparker profile image
Sean

Awesome post Lynne. This helped me clean up way too many double imports.

Emmanuel, I was a little confused too.

For the stylesheet that you call into vue.config.js only import mixins and variables (no style selectors/rules).

Call other global.scss (declared rules and stuff) elsewhere, like main.js or a parent app like App.vue.

Any style rules imported to a stylesheet through vue.config.js will import again for each component that uses it.