Sass get-function() Function

Last Updated:

Sass get-function() Function

The get-function() function returns the function named $name. This can access both built-in and user-defined functions.

Note: By default, it throws an error if $name doesn't refer to either a built-in or user-defined function. However, if $css is true, it instead returns a plain CSS function.

Example

SASS TO CSS CONVERTER
@function foo($x) { @return $x; } $myFun: get-function(foo); p{ color: $myFun(#8c8c8c) }

Syntax

get-function($name, $css)

Parameter Value

ValueTypeExplanation
$name Required Specifies the name of the function.
$css Optional Specifies whether the function should return a plain CSS function or not. Default value is false.

Return Value

ValueExplanation
function Returns the function to a calling variable.

Share this Page

Meet the Author