DEV Community

loading...

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

Collapse
deiknymi profile image
Akash Kumar Verma

Why import example.scss again in components when using global import already. I like to import all my general styles in vue.conf.js, then it is available inside every component without importing anything.

Collapse
lynnewritescode profile image
Lynne Finnigan Author

The idea is that your global styles are only variables and things you need access to globally. When you import example.scss it has the attribute ‘scoped’, which means it’ll only render if that component is rendered on the page. Saves you loading a larger css file with css that isn’t being used. Hope this helps!