How to handle partials in an scss project?

前端 未结 2 782
失恋的感觉
失恋的感觉 2021-01-26 00:41

Following problem: On my server I got a style.scss file in the main directory - I used sass --watch style.scss:style.css --style compressed and so everytime style.s

2条回答
  •  北海茫月
    2021-01-26 01:22

    Standard way to do this is to separate sass files form compiled css files. In your my_theme_main_folder create folder sass and move all the scss files to it, including partials (you can structure them as you like).

    Then run from the level of my_theme_main_folder:

    sass --watch sass:css
    

    It will watch the whole my_theme_main_folder/sass folder and compile everything to my_theme_main_folder/css folder on any change in the first folder.

提交回复
热议问题