meta.inspect($value) returns an unquoted string representation of any Sass value—not just values that can appear in CSS. Load it with @use "sass:meta".
Official samples.
meta.inspect(10px 20px 30px) → 10px 20px 30px · map ("width": 200px) · null · quoted "Helvetica".
Debugging only.
Official heads-up: the format is not guaranteed across Sass versions or implementations. Do not depend on the exact string in production CSS.
Prefer @debug in real projects.
Official docs use @debug meta.inspect(…), which prints to the compiler. These examples put the string in a custom property so you can open View Compiled CSS.
Syntax
Syntax
SCSS
@use "sass:meta";
meta.inspect($value); //=> unquoted string
@debug meta.inspect(10px 20px 30px); // 10px 20px 30px
@debug meta.inspect(("width": 200px)); // ("width": 200px)
@debug meta.inspect(null); // null
@debug meta.inspect("Helvetica"); // "Helvetica"
// Global alias (legacy): inspect($value)
// Prefer meta.inspect after @use "sass:meta"
Pattern: pass any value → get a readable string → print with @debug (or temporary CSS while learning) → remove before shipping.
Reference
What Inspect Shows
Common value shapes and typical inspect text:
Value
Typical inspect text
Notes
List 10px 20px 30px
10px 20px 30px
Space-separated as written
Map ("width": 200px)
("width": 200px)
Maps are Sass-only
null
null
No CSS form of its own
Quoted string
"Helvetica"
Quotes stay visible
Number / boolean
42 / true
Simple snapshots
vs meta.type-of.
meta.type-of answers “what kind?” (map, string, …). inspect answers “what does it look like?”
Examples use @use "sass:meta" and put inspect text into custom properties so you can open View Compiled CSS (matches official Sass docs samples where shown). Prefer @debug in day-to-day work.
Example 1 — Inspect a List
Space-separated lengths become a readable string.
SCSS
@use "sass:meta";
// @debug meta.inspect(10px 20px 30px);
:root {
--list: #{meta.inspect(10px 20px 30px)};
}
Compiled CSS
:root {
--list: 10px 20px 30px;
}
How It Works
Pass a list of lengths.
inspect returns an unquoted string.
Interpolation places that text in CSS.
Matches the official docs list sample.
Example 2 — Inspect a Map
Maps are Sass-only; inspect shows their structure as text.
Stringifies any Sass value for humans reading the compiler.
Not guaranteed CSS and not a stable public format.
Prefer @debug meta.inspect(…) while developing.
Use type-of for kinds; use inspect for value snapshots.
One line: when you need a readable snapshot of any Sass value, use meta.inspect($value).
Practice
Compile Notes
Practical checklist:
checklist.txt
1. @use "sass:meta"
2. @debug meta.inspect($value)
3. Or temporary: --peek: #{meta.inspect($value)}
4. Do not ship inspect-dependent CSS
5. Prefer type-of when you only need the kind
Frequently Asked Questions
meta.inspect($value) returns an unquoted string representation of any Sass value—lists, maps, null, strings, numbers, and more—so you can see what Sass holds during compilation.
Not always. Official docs: inspect can represent values that cannot appear in CSS, so the string is not guaranteed to be valid CSS. Prefer it for @debug or temporary custom properties while learning.
No. Official heads-up: inspect is for debugging and its format is not guaranteed to stay the same across Sass versions or implementations. Do not build production CSS that depends on the exact string.
type-of returns the type name (number, string, map, …). inspect returns a full string snapshot of the value itself.
Yes. inspect($value) is the legacy global name. Prefer meta.inspect after @use "sass:meta".
Usually no. Use it while debugging with @debug or temporary tokens, then remove it from production CSS.