chroma
chroma copied to clipboard
Deprecate global $chroma variable
Currently, libSass has no way to access a global Sass variable from the JavaScript side.
So while libSass allows functions to be written in JS, the JS can only access the functions parameters and cannot access any global Sass properties, like variables, mixins, extends, etc.
So the only way the JavaScript side can access Chroma's variables is by explicitly passing the $chroma
global variable into the Sass function.
There are open issues for this in the libSass and node-sass queues. https://github.com/sass/node-sass/issues/1297 https://github.com/sass/libsass/issues/1950
Until that is fixed upstream, Chroma must continue to require explicit use of the global $chroma
variable in its code examples.