Open ncoden opened 6 years ago
@HugoGiraudel
There's an alternative approach that would maintain BC with older Sass. You could instead have a safe-call-function
. See a very simplified example below.
@function safe-call-function($name, ...$args) {
@if function-exists('get-function') && type-of($name) == string {
@return call(get-function($name), ...$args);
}
@return call($name, ...$args);
}
This approach will work on all version Sass so theres no need for the @error
.
That’s a good idea (expect for &&
that should be and
in Sass ;)), let’s do this. :)
@HugoGiraudel @xzyfer I applied the required changes. See PR description
hmmm actually I found a more suitable way to make these checks. See https://github.com/zurb/motion-ui/pull/117. I think I'll make a package from it.
Done. See https://github.com/ncoden/sassy-functions. @HugoGiraudel @xzyfer I'll use it for this pull request, after I added some tests.
Fix the following deprecation warning:
Call
call()
with a function retrieved by the new functionget-function
.Changes:
sl-safe-call-function
polyfill forcall()
with support of both function (LibSass >= 3.5) and function name string (LibSass < 3.5)sl-safe-call-function
instead ofcall()
Closes https://github.com/at-import/SassyLists/issues/63