Reference Functions
Some of the functions provided by Sass Fairy return a reference to a function so they may be used as parameters in other function calls. Examples of this are the compare methods from @sass-fairy/list
.
$sorted: list.sort($unsorted, list.compare-numeric())
However, these methods will function normally when provided with parameters. This allows other libraries to use these functions directly.
$first-item: 5
$second-item: 3
$result: list.compare-numeric($first-item, $second-item)
Implementing in Custom Modules
Creating these functions in you own modules is very easy using the meta.call-or-reference()
from the @sass-fairy/meta
package. Read the API for more details.