Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure Koala Sass auto compile on partials changes?

I'm using Koala for Win64 to compile sass (with lot of partials) to css with no problems, but Koala auto compile function is only runs when there are updates in root scss file, so I need to open Koala and press 'compile' button every time when I made changes to included partials.

Is there any way to configure scss auto compile to watch for changes in sass partials?

like image 518
user3058355 Avatar asked Aug 09 '14 07:08

user3058355


2 Answers

So came across this as I was having problems myself. Just documenting...

1st thing I did

was to create a style.scss or global.scss (making sure to setup "Auto Compile" in Koala) and only fill it with imports:

@import 'layout'; //_layout.scss
@import 'layout_modules'; // _layout_modules.scss
@import 'modules'; // _modules.scss
@import 'theme'; // _theme.scss

When I would work on the partials (partials will have a _ in front of the filename) and save I would get an autocompile confirmation (Koala Settings > General > "Notification when compile is completed")

But _layout_modules.scss would not trigger autocompile on save. If I switched over to another partial and saved, it would autocompile and Koala would still throw helpful errors for _layout_modules.scss.

2nd thing I did

then, was to remove the extra underscore in the filename - so it would just be _layoutmodules.scss (make sure to update your @import on style.scss) and worked as expected.

(I've been using Sass for all of 5 days.)

like image 105
Phil Tune Avatar answered Oct 27 '22 18:10

Phil Tune


Short answer: add _ before partial files and import them to the main file.

Thanks to @philtune

like image 1
Amirmasoud Avatar answered Oct 27 '22 18:10

Amirmasoud