CSS Variables
This exposes getCSSVar and setCSSVar utility functions to get and set CSS variables easily.
Get CSS Variables easily
You don’t have to remember to use getComputedStyle and getPropertyValue to get CSS variables anymore. They’ve been packed into a single useful utility.
// Getting a CSS Variableconst value = getCSSVar('.selector', '--width')Set CSS Variables easily
Likewise, no need to remember browser API for setting a CSS Variable too — everything has been made into an easy to use setCSSVar function for you.
// Setting a CSS VariablesetCSSVar('.selector', '--width', '100px')