0

I have a mixins file, which I constantly develop. I use it in every project, but sometimes I need to go back and I not always remember to copy the new file, so it causes confusion (plus, it's really counterproductive, having to copy a single file to each project).

What I thought today, that it would be great if I could import a scss file either from remote hos (a dropbox url) or an absolute path. I tried using this:

@import 'F:/XAMPP/htdocs/RATIUG/ratiug/reset';

and

@import 'http://myDropboxLink';

but neither worked. Can I solve this somehow?

Tomek Buszewski
  • 7,659
  • 14
  • 67
  • 112
  • possible duplicate of [Can I import an externally hosted file with sass?](http://stackoverflow.com/questions/16947337/can-i-import-an-externally-hosted-file-with-sass) – cimmanon Jun 22 '14 at 11:33

1 Answers1

0

When Sass encounters @import with a protocol, it assumed that is a CSS directive. So, you have to precise a shared folder.

Solution with Sass

If you uses Sass in standalone mode, you can add the --load-path argument to precise the shared folder:

$ sass --load-path F:/XAMPP/htdocs/RATIUG styles.scss

Now, you can call your reset mixin:

@import "ratiug/reset";

Solution with Compass

Simply add the shared path in your config.rb with add_import_path:

sass_dir = "sass"
css_dir = "css"
add_import_path File.expand_path("F:/XAMPP/htdocs/RATIUG")
piouPiouM
  • 4,937
  • 1
  • 21
  • 22