Sass watch is detecting changes but not compiling to css

时光毁灭记忆、已成空白 提交于 2019-12-05 05:36:23
iamlukem

Make sure the file you are saving with an _filename.scss has been properly imported into the mainfile.scss. if you have not imported the _filename.scss it will detect a change but not compile.

I had the same issue! In my case, it was caused by having several @imports listed like this:

@import 'colors';
@import 'fonts';
@import 'size';

When i changed it to this it all started working again:

@import 'colors', 'fonts', 'size';

Although it should not be needed:
"Sass imports have the same syntax as CSS imports, except that they allow multiple imports to be separated by commas rather than requiring each one to have its own @import." - sass-lang.com/documentation

check for the Config.rb file in your folder. without it you have to Ctr c every time and pass this command sass --watch scssname:cssname

then You can find your code in css.

Are you sure all of your partials are being imported into app.scss? I had the same issue, only to realize the partial file I was modifying (_custom.scss) wasn't actually being imported by the main.scss.

Create scss file by correct naming (make sure there is underscore "_")

_custom.scss

Import _custom.scss in main.scss (no underscore required)

// main.scss
      @import "custom";

Compile the code

sass --watch main.scss main.css

This will compile the code properly.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!