DEV Community

Discussion on: Harnessing The Power Of CSS Variables With JavaScript

Collapse
 
galaxy4public profile image
(GalaxyMaster)

The fallback for older browsers is misrepresented here. The construct presented here, var(--variable, default), is for when a variable is undefined. The fallback for older browsers that do not support variables would be defining the same attribute without a call to var() before a more modern definition, so the cascade will take care of unknown value by respecting the prior definition.

Collapse
 
ibn_abubakre profile image
Abdulqudus Abubakre

oh wow, thanks for the correction