meta.apply($mixin, $args...) is a mixin that includes a mixin value with the given arguments. If you pass a @content block to @include meta.apply(...), that content is forwarded to $mixin. Load it with @use "sass:meta" on Dart Sass 1.69+.
Official sample idea.
Build an apply-to-all helper that loops a list and calls @include meta.apply($mixin, $element) for each item—for example generating .font-8px, .font-12px, and .font-2rem.
Pattern: resolve a mixin value → @include meta.apply with args → optionally forward @content. Check meta.accepts-content first when content is optional.
Reference
apply vs call
Same dynamic idea, different member types:
Helper
Runs
How you use it
meta.apply
Mixin value
@include meta.apply(...) — emits CSS / can take @content
meta.call
Function value
Expression / assignment — returns a value
meta.get-mixin
—
Builds the mixin value you apply
meta.get-function
—
Builds the function value you call
Forwarding content.
If the target mixin cannot accept @content, do not pass a content block—or guard with meta.accepts-content.
One line: when a mixin value must be included dynamically (with optional content), call @include meta.apply($mixin, $args...).
Practice
Compile Notes
Practical checklist:
checklist.txt
1. @use "sass:meta"
2. Resolve a mixin value (get-mixin / module-mixins)
3. @include meta.apply($mixin, $args...)
4. Optionally forward @content (guard with accepts-content)
5. Use meta.call for function values
Frequently Asked Questions
meta.apply($mixin, $args...) includes a mixin value with the given arguments. Use it with @include. It is the mixin counterpart to meta.call(), which runs function values.
Usually with meta.get-mixin("name") for a mixin in the current module, or from meta.module-mixins($namespace). You cannot pass a plain string to meta.apply—pass a mixin value.
Yes. If you pass a @content block to @include meta.apply(...), that content is forwarded into the applied mixin.
It is a mixin from sass:meta. You include it with @include meta.apply(...). It emits CSS through the mixin it runs; it does not return a value like map.get.
meta.apply runs mixins (CSS / @content). meta.call runs functions (returns a value). Same idea—dynamic invocation—different Sass member types.
Dart Sass 1.69+. LibSass and Ruby Sass do not provide this meta mixin API. Prefer current Dart Sass.