meta.calc-args($calc) returns a list of arguments from a CSS calculation value such as calc(), clamp(), min(), or max(). Load it with @use "sass:meta" on Dart Sass 1.40+.
Examples target Dart Sass 1.40+ with @use "sass:meta". Open View Compiled CSS for verified output. Lists are shown via meta.inspect / item types so CSS stays readable.
Example 1 — Official Docs Sample (calc)
One mixed-unit expression becomes a single string argument.
Numbers stay numbers; expressions / vars become strings.
Pair with calc-name to describe the whole value.
Dart Sass 1.40+ via @use "sass:meta".
One line: when you need the argument list inside a CSS calculation at compile time, call meta.calc-args($calc).
Practice
Compile Notes
Practical checklist:
checklist.txt
1. @use "sass:meta"
2. Pass a calc / clamp / min / max value
3. Expect a list (use list.nth / list.length)
4. Check meta.type-of before doing math on an item
5. Pair with meta.calc-name for the function name
Frequently Asked Questions
meta.calc-args($calc) returns a list of the arguments inside a CSS calculation value such as calc(), clamp(), min(), or max(). Use it to inspect or transform those arguments at compile time.
Official docs: if an argument is a number or a nested calculation, it is returned as that type. Otherwise it is returned as an unquoted string—for example var(--width) or an expression like 100px + 10%.
That calc() call has a single expression argument. Sass cannot split mixed-unit math into separate number args, so the whole expression becomes one unquoted string.
meta.calc-name($calc) returns the calculation’s name as a quoted string (calc, clamp, min, …). meta.calc-args returns the argument list inside that calculation.
No. Pass a calculation value. Plain lengths like 10px are numbers, not calculations—wrap or build a calc()/clamp()/min()/max() first.
Dart Sass 1.40+. LibSass and Ruby Sass do not provide this helper. Prefer current Dart Sass.