Most CSS functions are plain Sass function calls: Sass evaluates the arguments and writes the call back out as CSS. A small group of functions needs special parsing because their arguments are not ordinary SassScript—for example an unquoted url(...).
These special functions return unquoted strings (except calculations, which are their own value type). Interpolation with #{} still works inside them.
Modern math lives elsewhere.
calc(), clamp(), min(), and max() are now first-class calculations. See Sass calculations instead of treating them as legacy special functions.
Pass-through functions.
var() and env() are not evaluated by Sass at compile time. They are written to the CSS so the browser resolves them.
Legacy IE helpers.
expression() and progid:... exist only for very old Internet Explorer. Sass keeps them working but you should not use them in new code.
Sass values like math.max() run at compile time. CSS functions like max() or var() are resolved by the browser (or simplified by Sass when every argument is a compatible number).
Most special-function problems are quoting, interpolation, or expecting Sass to compute browser-time values.
quotes
url() quoting changes the output
An unquoted url(...) stays unquoted, but url($var) evaluates the variable and writes it as a quoted string. Interpolate with #{} when you need the unquoted form.
browser
var() and env() are not computed by Sass
Sass cannot know custom property or environment values. Use Sass variables when the value is known at compile time.
units
Mixed units stay as CSS functions
min(100%, 600px) cannot be reduced because % and px are not comparable at compile time.
legacy
expression() is legacy
Sass passes it through, but modern browsers ignore it. Do not rely on it.
Toolchain
Sass Support
Special-function parsing is part of core Sass; calculations require a modern Dart Sass.
Special functions have arguments that are not normal SassScript.
url(), element(), progid:, expression() pass through as unquoted strings.
var() and env() stay in the CSS for the browser to resolve.
calc(), clamp(), min(), max() belong to calculations.
One line: let Sass pass special CSS functions through, and use #{} when you need to inject Sass values.
Practice
Compile Notes
Practical checklist:
checklist.txt
1. Use #{$var} inside unquoted url(...)
2. Expect var() / env() to stay in the CSS
3. Do not use expression() or progid: in new code
4. Use calculations for calc / clamp / min / max
5. Check the compiled CSS when mixing units
Frequently Asked Questions
They are CSS functions whose arguments cannot be parsed as normal SassScript, such as url(), element(), expression(), and progid:. Sass passes them through as unquoted strings.
Yes. Use interpolation, for example url(#{$cdn}/hero.png). A quoted url("...") is an ordinary string.
No. Sass writes var() and env() to the CSS so the browser resolves them. Fallback arguments are evaluated as SassScript first.
They used to be treated as special strings. In current Dart Sass they are first-class calculations that can be simplified. See the calculations page.
No. They only target very old Internet Explorer. Sass preserves them but modern browsers ignore them.
Because url($var) is evaluated as an ordinary function call and the string value is quoted. Use url(#{$var}) when you want unquoted output.