Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watch imported SCSS files, shorthand notation #41

Closed
zedzedzed opened this issue Jun 25, 2013 · 10 comments
Closed

Watch imported SCSS files, shorthand notation #41

zedzedzed opened this issue Jun 25, 2013 · 10 comments

Comments

@zedzedzed
Copy link

Hi - Koala doesn't appear to be watching over imported SCSS files with the shorthand notation, see http://sass-lang.com/tutorial.html#id1

As an example, only the second line will be watched for modifications from below:

master.scss

@import "global/variables";
@import "global/_normalize.scss";

This issue is unrelated to #24

@oklai
Copy link
Owner

oklai commented Jun 25, 2013

I was tested, both of two files are watched.
test command: sass --watch style.scss:style.css
sass version: 3.2.7

2013/6/25 zedzedzed notifications@github.com

Hi - Koala doesn't appear to be watching over imported SCSS files with the
shorthand notation, see http://sass-lang.com/tutorial.html#id1

As an example, only the second line will be watched for modifications from
below:

master.scss

@import "global/variables";
@import "global/_normalize.scss";

This issue is unrelated to #24 #24


Reply to this email directly or view it on GitHubhttps://github.com//issues/41
.

@zedzedzed
Copy link
Author

Not for me, I'm using Koala 1.4.1 on OSX 10.8.4. Is there a log that I can use to help troubleshoot?

Current test case:

  • test/master.scss (contents as above)
  • test/global/_variables.scss
  • test/global/_normalize.scss

Told Koala to watch the test directory but it won't act on changes to _variables.scss.

@oklai
Copy link
Owner

oklai commented Jun 25, 2013

Whether you don't want to watch the imported file which without specifying
a file extension?

2013/6/25 zedzedzed notifications@github.com

Not for me, I'm using Koala 1.4.1 on OSX 10.8.4. Is there a log that I can
use to help troubleshoot?

Current test case:

  • test/master.scss (contents as above)
  • test/global/_variables.scss
  • test/global/_normalize.scss

Told Koala to watch the test directory but it won't act on changes to
_variables.scss.


Reply to this email directly or view it on GitHubhttps://github.com//issues/41#issuecomment-19956369
.

@zedzedzed
Copy link
Author

http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#import

The link suggests that you can omit the extension and it will try both .scss and .sass files for import. The _ means it is a partial. I was wondering shouldn't changes to these files trigger it to be recompiled? Eg, in the _variables.scss case, you can have colour, sizing, font (and more) definitions so surely changes should trigger a recompile? Is there something I'm doing wrong?

@oklai
Copy link
Owner

oklai commented Jun 25, 2013

You mean that the "variables" file does not be watched? Which version of your koala, I have tested it in the latest version, "variables" has been watched, when "variables" file changes, it will trigger "master.scss" recompile.

@zedzedzed
Copy link
Author

Yep _variables.scss not watched when imported like:

@import "global/variables";

I've done some more testing and hopefully this makes it easier to replicate, files are:

/master.scss
/includes/_test1.scss
/includes/_test2.scss
/includes/_test3.scss
/includes/_test4.scss

master.scss

@import "includes/test1";           // no
@import "includes/_test2.scss";     // works
@import "includes/test3.scss";      // no
@import "includes/_test4";          // works

From my testing above, it appears that imported files are watched if they have the filename spelled out exactly (extensions can be omitted). From above, _test2.scss and _test4.scss are watched, the others are not. Not sure if this is a Sass or Koala thing... According to the Sass docs, the _ is omittable.

@oklai
Copy link
Owner

oklai commented Jun 26, 2013

I get it. @import "includes/test" the real imported file is "_test.scss". If there are two files "_test.scss" and "test.scss" at the same time, Sass is preferred to use "_test.scss".
I'll fix it in next version, thank you for your feedback. ^-^

@tsi
Copy link

tsi commented Aug 1, 2013

Just bumped into this issue as well. Thank you @oklai !

@istrasoft
Copy link

Same here :(

@tsi
Copy link

tsi commented Nov 25, 2013

For me this works fine now with latest version on linux. thanks.

@oklai oklai closed this as completed Jul 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants