concept
var-fallback — CSS reference
Fallback handles an unavailable or guaranteed-invalid custom property, not every invalid destination. Nested fallbacks provide defaults in sequence. A valid empty custom property differs from a missing one; a bare comma supplies an empty fallback.
Formal Syntax & Structure
css syntaxcss
var(--primary, var(--secondary, 32px))Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS substitution lab</title><style>body {margin:0} .sample {height:12px;background:#006050}#parent {width:300px} .sample {width:40px;height:30px;margin-bottom:4px;color:white}#parent{--secondary:64px} #a{width:var(--missing,var(--secondary,32px))} #b{width:var(--missing,var(--also-missing,32px))}</style><body><div id="parent"><div id="a" class="sample">A</div><div id="b" class="sample">B</div></div></body></html>