-
Notifications
You must be signed in to change notification settings - Fork 27
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
fix: fix libsass 4 call deprecation warning #63 #65
base: master
Are you sure you want to change the base?
fix: fix libsass 4 call deprecation warning #63 #65
Conversation
/// | ||
/// @return {Function|String} | ||
/// | ||
@function safe-get-function($name) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall this be prefixed with sl-
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should, yes.
There's an alternative approach that would maintain BC with older Sass. You could instead have a @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 |
That’s a good idea (expect for |
Use `sl-safe-call-function` instead and add a warning message to encourage users to switch to first-class functions. sl-safe-call-function($func, ...$args) Polyfill for the `call` function supporting both functions and strings.
@hugogiraudel @xzyfer I applied the required changes. See PR description |
hmmm actually I found a more suitable way to make these checks. See foundation/motion-ui#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 #63