0

When you have a wrapper stylesheet that imports other using sass @import, and when using guard to watch for changes, it wont compile the wrapper stylesheet automatically if you are only changing one of the imported files. Example:

/* This is viewports.scss, which must compile into viewports.css */
@media only screen and (min-width: 480px) {
    @import "480.scss";
}

@media only screen and (min-width: 768px) {
    @import "768.scss";
}

@media only screen and (min-width: 1024px) {
    @import "1024.scss";
} 

When modifying for example 480up.scss, it compiles as expected into 480up.css, but Guard is not importing it into the viewports.css, seems like is not recognizing the dependency. This use is important when you want to implement responsive in one compiled css, but writing your code in separate scss files.

If you just use the sass command you have the expected behavior, if you use Guard, not.

Is there some workaround for this? Something extra that I need to configure?

4

1 に答える 1

0

Guard はファイルの依存関係について何も認識せず、ファイル システムの変更に関するイベントを簡単に処理するためのベースを提供するだけです。sass には 2 つの Guard プラグインがあるようです。

積極的にメンテナンスされているので、guard-sass を選択します。ドキュメントを読んでいるとき、私は見る

:smart_partials => true # Causes guard-sass to do dependency resolution and only
                        # recompile the files that need it when you update partials.
                        # If not on, then guard-sass will update all files when a
                        # partial is changed.
                        # default: false

したがって、guard-sass はすでにケースを適切に処理する必要があるようです。

于 2013-04-01T13:52:58.740 に答える