meta.call() belongs to the built-in sass:meta module. It invokes a function value with arguments and returns the result. This page covers meta.get-function, higher-order helpers, the deprecated string form, vs meta.apply, and five compiled examples.
01
Concept
Call a function value
02
Module
@use "sass:meta"
03
Source
meta.get-function
04
Returns
Function result
05
vs apply
Functions vs mixins
06
Practice
5 examples
Concept
What Is meta.call()?
Normally you write math.pow(2, 8) with the function name fixed. Sometimes you want to pass a function into another function—a filter, a mapper, a condition. Sass represents that as a function value. meta.call runs it.
$function must be a function value (usually from meta.get-function)
Extra arguments are forwarded to that function
The return value is whatever the invoked function returns
💡
Beginner tip
Think of meta.get-function as picking a tool from a toolbox, and meta.call as using that tool. For mixins that emit CSS, use meta.apply instead.
Foundation
📝 Syntax
styles.scss
@use "sass:meta";
// Recommended
meta.call($function, $args...)
// Legacy global name (same idea)
call($function, $args...)
Parameters
Parameter
Type
Required
Description
$function
Function value
Yes
Function to invoke. Get one with meta.get-function($name). Avoid passing a string name (deprecated).
$args...
Any (variadic)
No
Arguments forwarded to the function value.
Return value
Type
Result
Any
Whatever the invoked function returns (number, color, list, boolean, …)
Modules
📦 Loading sass:meta
styles.scss
// Recommended — namespaced
@use "sass:meta";
@use "sass:math";
$result: meta.call(meta.get-function("abs", $module: "math"), -4);
// Optional — bring members into scope
@use "sass:meta" as *;
$result: call(get-function("abs", $module: "math"), -4);
// Legacy global
$result: call(get-function("abs", $module: "math"), -4);
Details
🔗 Pair with meta.get-function
Official rule: $function must be a function value. Resolve it first:
meta.get-function($name, $module: "ns") — from a @use namespace
Migration
⚠️ Deprecated: String Names
Older LibSass / Ruby Sass accepted call("function-name", …). That still works for compatibility, but Sass docs mark it deprecated because modules mean a name may not be globally unique.
One meta.call site serves either adjuster. Change $mode to "lighten" without rewriting the property line. Local helpers wrap color.adjust so get-function can resolve them cleanly.
Example 5 — Map a List Through a Function
Apply the same function value to every spacing token.
map-call never hard-codes scale-space. It receives any function value and builds a new list of results; the second scaled value is 10px.
Applications
🚀 Real-World Use Cases
Higher-order helpers — filters, mappers, and reducers over lists (official remove-where).
Theme adjusters — choose make-darker / make-lighter (or similar helpers) from config, then call once.
Module bridging — invoke sass:math / sass:color members via get-function + $module.
Plugin APIs — accept a function value from consumers instead of a fixed name.
Migration off string call() — replace deprecated call("name", …) safely.
🧠 How Compilation Works
1
Resolve a function value
Call meta.get-function("name") (optionally with $module).
Source
2
Invoke meta.call
Pass the function value and arguments.
Compile
3
Receive the result
Use the returned value in properties, lists, or further math.
Result
4
✓
CSS ships
Browsers never see meta.call—only finished values.
Watch Out
⚠️ Common Pitfalls
String first argument — deprecated; resolve with meta.get-function first.
Confusing with meta.apply — functions return values; mixins emit CSS.
Wrong arity — argument count must match the target function.
Missing $module — built-ins from sass:math need the namespace when using get-function.
Expecting runtime JS callbacks — everything resolves when Sass compiles.
Pro Tips
💡 Best Practices
✅ Do
Use @use "sass:meta" and meta.call()
Pass function values from meta.get-function
Build small higher-order helpers (filter / map)
Migrate old call("name", …) call sites
Prefer Dart Sass for modules
❌ Don’t
Pass a bare string as $function in new code
Use meta.call when you need a mixin (meta.apply)
Expect the browser to evaluate meta.call
Forget $module for namespaced built-ins
Rely on string call() for future-proof stylesheets
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about meta.call()
Invoke function values—never pass deprecated string names in new code.
5
Core concepts
📝01
Call
meta.call($fn, …)
API
📦02
Module
sass:meta
@use
🔗03
Input
function value
Rule
⚠️04
Strings
deprecated
Safe
✓05
vs apply
functions vs mixins
Tooling
❓ Frequently Asked Questions
meta.call($function, $args...) invokes a function value with the given arguments and returns the result. It is how you run a function when you hold a reference to it instead of writing its name directly.
Use meta.get-function("name") for a function in the current module, or pass $module for a @use namespace. You can also take function values from meta.module-functions.
It still works in current implementations, but Sass marks passing a string name as deprecated. Prefer meta.get-function() first, then meta.call($fn, …). String call() will be disallowed in future versions.
meta.call runs function values and returns a value. meta.apply includes mixin values and emits CSS (and can forward @content). Same dynamic idea, different member types.
Yes. call($function, $args...) is the legacy global name. Prefer meta.call after @use "sass:meta".
Dart Sass fully. LibSass and Ruby Sass support call with function values since about 3.5. Always prefer current Dart Sass for the module system.
Did you know?
Official Sass docs motivate function values (and deprecating string call()) for the module system: once functions live in namespaces, a bare name string may not refer to the same function everywhere—so you pass the resolved value instead.
meta.call() runs a function value with arguments and returns the result—the foundation for higher-order Sass helpers. Always resolve with meta.get-function, avoid deprecated string names, and use meta.apply when you need mixins instead of functions.