A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://sass-lang.com/documentation/js-api/types/CustomFunction below:

Website Navigation


Sass: CustomFunction | JS API

A callback that implements a custom Sass function. This can be passed to functions.

const result = sass.compile('style.scss', {
functions: {
"sum($arg1, $arg2)": (args) => {
const arg1 = args[0].assertNumber('arg1');
const value1 = arg1.value;
const value2 = args[1].assertNumber('arg2')
.convertValueToMatch(arg1, 'arg2', 'arg1');
return new sass.SassNumber(value1 + value2).coerceToMatch(arg1);
}
}
});
Throws

any - This function may throw an error, which the Sass compiler will treat as the function call failing. If the exception object has a message property, it will be used as the wrapped exception's message; otherwise, the exception object's toString() will be used. This means it's safe for custom functions to throw plain strings.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4