meta.get-function($name, $css: false, $module: null) returns a function value for the named function. Invoke it with meta.call(). Load it with @use "sass:meta".
Official sample idea.
Pass meta.get-function("contains-helvetica") into a higher-order helper that uses meta.call($condition, $element)—for example filtering font names.
$module for namespaces.
After @use "sass:math", resolve module members with $module: "math". The parameter can also be a module value.
Missing names.
By default, an unknown Sass function throws. With $css: true, Sass returns a plain CSS function instead. Do not combine $css: true with $module.
Syntax
Syntax
SCSS
@use "sass:meta";
@use "sass:math";
meta.get-function($name, $css: false, $module: null); //=> function
meta.call(meta.get-function("abs", $module: "math"), -12px); // 12px
meta.call(meta.get-function("blur", $css: true), 4px); // blur(4px)
// Global alias (legacy): get-function(...)
// Prefer meta.get-function after @use "sass:meta"
Pattern: resolve a function value → meta.call with args → use the result. Check first with meta.function-exists when the API is optional.
Reference
$module and $css
How the options change lookup:
Options
Behavior
Default
Un-namespaced Sass function (including global built-ins)
$module: "math"
Function named in that @use namespace
$css: true
Plain CSS function value if no Sass function matches
Returns a function value for a name (and optional module).
Invoke with meta.call; use $css: true for plain CSS functions.
Pair with function-exists for optional APIs.
Mixin counterpart:meta.get-mixin + meta.apply.
One line: when you need a function value to pass around or call dynamically, use meta.get-function($name, $css: false, $module: null).
Practice
Compile Notes
Practical checklist:
checklist.txt
1. @use "sass:meta"
2. meta.get-function("name") or with $module
3. meta.call($fn, $args...)
4. Use $css: true only for plain CSS functions
5. Prefer function-exists before optional lookups
Frequently Asked Questions
meta.get-function($name, $css: false, $module: null) returns a function value for the named function. You typically run that value with meta.call($fn, $args...).
When the function lives under a @use namespace. For example meta.get-function("abs", $module: "math") after @use "sass:math". The string must match that file’s namespace.
By default, a missing Sass function name throws. With $css: true, get-function returns a plain CSS function value instead—useful when you want to emit CSS like blur() as a function reference. It’s an error to combine $css: true with $module.
function-exists returns true/false. get-function returns the actual function value (or errors unless $css is true). Check with exists first for optional APIs.
Use meta.call($function, $args...). Passing a string name directly to call() is deprecated—get-function is the modern first step.
Yes. get-function($name, $css: false, $module: null) is the legacy global name. Prefer meta.get-function after @use "sass:meta".