// Access --my-var, or if it doesn't exist returns 'red' styles.my_var;
Hyphen case (eg 'my-var') is a common way of delimiting words in CSS variables, but
can't be (elegantly) used in object properties. Instead, use '_' in the
object key, which is replaced with '-'.
Computes the styles for
elt
(or defaults to document.body) usingfallback
as a set of default values.Hyphen case (eg 'my-var') is a common way of delimiting words in CSS variables, but can't be (elegantly) used in object properties. Instead, use '_' in the object key, which is replaced with '-'.
The leading '--' is not needed either.