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

Support for SASS_PATH #90

Closed
craigbarnes opened this issue Feb 19, 2013 · 13 comments
Closed

Support for SASS_PATH #90

craigbarnes opened this issue Feb 19, 2013 · 13 comments

Comments

@craigbarnes
Copy link
Contributor

Just making a note of this Sass 3.2 feature, not currently supported by libsass:

You can now set the SASS_PATH environment variable in your shell (a.k.a terminal) to a colon delimited list of directories and Sass will automatically look in each of them when finding a file for @import.
In ruby, the SASS_PATH environment variable will be loaded into the mutable property Sass.load_path where it can further manipulated if necessary. Sass.load_path defaults to an empty array.
-- http://chriseppstein.github.com/blog/2012/08/23/sass-3-2-is-released/

@HamptonMakes
Copy link
Member

I'm not 100% sure this is something that should be in libsass. Seems more like SassC or a wrapper's job. We try and keep as much OS-specific stuff out of libsass as we can.

@chriseppstein
Copy link
Contributor

Are there docs on what is required of wrappers using libsass in order to create a compliant implementation?

@lbastendorff
Copy link

Is this not what the sassc -I (import) option does, or am I missing something?

Usage: ../sassc [OPTION]... [FILE]

Options:
-o OUTFILE Write output to specified file.
-t NAME Output style. Can be: nested, compressed.
-l Emit comments showing original line numbers.
-g Emit source map.
-I PATH Set Sass import path.
-h Display this help message.

Or was this option added in response to this issue and therefore this issue should now be closed?

@craigbarnes
Copy link
Contributor Author

We try and keep as much OS-specific stuff out of libsass as we can.

getenv is in C89.

Is this not what the sassc -I (import) option does, or am I missing something?

Yes, of course, but environment variables aren't the same thing as arguments. Some programs take command-line arguments, some take config files, some take API arguments but none of those things are visible to libsass without being passed explicitly. The environment is to available to all linked libraries and sub-processes automatically.

In a way, SASS_PATH is part of a public API, if people are already using it in Makefiles and build systems.

@lbastendorff
Copy link

Got it. Failed to realise we were talking about environment variables.

@HamptonMakes
Copy link
Member

Yeah, this is something that the host wrapper should deal with. We want to work with environments without environment variables. Many host applications would certainly not want their embedded library referencing env variables with it being aware of it.

@craigbarnes
Copy link
Contributor Author

We want to work with environments without environment variables.

getenv is C89. Very few environments exist without environment variables.

Many host applications would certainly not want their embedded library referencing env variables with it being aware of it.

Every process running on your system right now is referencing env variables. For example, libc uses LANG, LC_NUMERIC etc.

@HamptonMakes
Copy link
Member

libsass is loosely modeled on libraries like libxml, which (afaik) don't use environment variables to change their behaviour. This is a very, very, very easy feature to add to sassc which would be the appropriate place to handle interactions with the operating system.

What adaptor are you using?

@chriseppstein
Copy link
Contributor

Agree, this should be supported by the libsass frontends. We should have a
guide of things that frontends are required to do in order to be a
compliant frontend.

@xtianus79
Copy link

So what was the final outcome of this? I feel it is should be native to using sass sheets however that is achieved

@xzyfer
Copy link
Contributor

xzyfer commented Oct 22, 2016

@xtianus79 as stated above this does not belong in LibSass, but in the adaptors. For instance it has recently been added to node-sass.

@metaskills
Copy link

If you are using Ruby and either Ruby Sass or SassC with SassC-Rails, we have found this little gem useful and everything just works no matter which pre-processor we use.

@metaskills
Copy link

WHOOPS! Link here: https://github.com/customink/sass_paths

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

7 participants