meta.module-functions() belongs to the built-in sass:meta module. It returns every function in a @used module as a map of names to function values. This page covers the official pow + meta.call pattern, built-in modules like sass:math, and five compiled examples.
01
Concept
Module function catalog
02
Module
@use "sass:meta"
03
Returns
Map of function values
04
$module
Must match a @use name
05
Call path
map.get + meta.call
06
Practice
5 examples
Concept
What Is meta.module-functions()?
Official docs: returns all the functions defined in a module, as a map from function names to function values. Think of it as opening a toolbox and seeing every tool labeled by name—ready to pick one with map.get and run it with meta.call.
$module must be a string matching a @use namespace in the current file.
Map keys are function names (strings). Map values are function values (not computed results).
Works for your own modules and built-ins like sass:math after you @use them.
Dart Sass 1.23+ only—LibSass and Ruby Sass do not support it.
💡
Beginner tip
meta.function-exists asks “is there one tool named pow?” meta.module-functions hands you the whole drawer of tools from that module.
Foundation
📝 Syntax
styles.scss
@use "sass:meta";
// Dart Sass 1.23+ (no legacy global name)
meta.module-functions($module)
Parameters
Parameter
Type
Required
Description
$module
String
Yes
Must match the namespace of a @use rule in the current file.
Return value
Type
Result
Map
Function names → function values (use with meta.call)
double(24px) returns 48px. If $name were missing, the @else branch would keep a safe fallback width.
Applications
🚀 Real-World Use Cases
Plugin registries — discover helpers a theme module exports, then call by name.
Dynamic math paths — pick math.div / math.pow from the catalog.
Documentation / debug peeks — print map.keys while building a design system.
Safe optional APIs — map.has-key before meta.call.
Module inventories — count or loop members for code generation at compile time.
🧠 How Compilation Works
1
@use a module
Load functions, sass:math, or another namespace.
Source
2
Build the function map
Call meta.module-functions("functions").
Compile
3
Pick and call
Use map.get + meta.call (or loop the keys).
Invoke
4
✓
CSS ships
Browsers never see the map—only finished values and rules.
Watch Out
⚠️ Common Pitfalls
Wrong namespace string — must match this file’s @use … as name exactly.
Module not loaded here — only @use rules in the current file count.
Confusing values with results — map values are function references, not already-computed numbers.
Calling without meta.call — you must run function values through meta.call.
Expecting LibSass — this API is Dart Sass only (1.23+).
Pro Tips
💡 Best Practices
✅ Do
Use @use "sass:meta" and meta.module-functions()
Store the map once in a variable when calling several times
Guard optional names with map.has-key
Prefer map.keys / meta.inspect for readable peeks
Run Dart Sass 1.23+
❌ Don’t
Pass a path string that is not a current-file @use namespace
Expect map values to be CSS-ready numbers without meta.call
Use it to list mixins or variables (use the sibling helpers)
Assume browsers evaluate the lookup
Rely on LibSass / Ruby Sass
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about meta.module-functions()
Get every function in a @use module as a map, then call what you need.
5
Core concepts
📝01
API
module-functions($module)
Call
📦02
Module
sass:meta
@use
📚03
Returns
map of functions
Result
🔗04
$module
@use namespace
Scope
✓05
Invoke
map.get + meta.call
Tooling
❓ Frequently Asked Questions
meta.module-functions($module) returns a map of every function defined in that @use module—keys are function names, values are function values you can run with meta.call.
A string matching the namespace of a @use rule in the current file—for example "functions" after @use "functions", or "math" after @use "sass:math".
Official pattern: meta.call(map.get(meta.module-functions("functions"), "pow"), 3, 4). map.get picks the function value; meta.call runs it.
function-exists answers yes/no for one name. module-functions returns the whole catalog of functions in a module as a map.
get-function looks up one function by name. module-functions returns all functions in a module at once—handy for registries, loops, and map.has-key guards.
Dart Sass 1.23+. LibSass and Ruby Sass do not. Prefer current Dart Sass.
Did you know?
Official Sass docs pair meta.module-functions with map.get and meta.call—the same idea as a dynamic import of every function in a file, resolved entirely at compile time.
meta.module-functions() returns a map of every function in a @used module. Match $module to that namespace, explore names with map.keys, and run helpers with map.get + meta.call on Dart Sass 1.23+.