Custom properties without fallback values can be converted to custom properties with fallback values (using SINGLE_CSS_VARIABLE_REGEXP).
e.g.
var(--known)
In this case, you can resolve the value of the custom property by examining the value of --known.
var(--unknown, var(--known)
This case can be converted to a custom property with a fallback value of the form var(--unknown, known-color) by resolving the --known value.
var(--unknown, var(--unknown, var(--known)))
This case can also be converted to a custom property with a fallback value of the form var(--unknown, var(--unknown, known-color)) by resolving the value of --known.
After converting to a custom property for which a fallback value exists, the value can be found using a regular expression that handles the custom property in this case (using CSS_VARIABLE_REGEXP).
Close #1363
Custom properties without fallback values can be converted to custom properties with fallback values (using
SINGLE_CSS_VARIABLE_REGEXP
).e.g.
var(--known)
--known
.var(--unknown, var(--known)
var(--unknown, known-color)
by resolving the--known
value.var(--unknown, var(--unknown, var(--known)))
var(--unknown, var(--unknown, known-color))
by resolving the value of--known
.After converting to a custom property for which a fallback value exists, the value can be found using a regular expression that handles the custom property in this case (using
CSS_VARIABLE_REGEXP
).