Reads the value of a CSS variable and assign it to HTML attributes or object field.
constoptions = [ // Set the 'width' attribute to the value of --some-css-variable to all elements with class 'blah' { query:`.blah`, variable:`some-css-variable`, attribute:`width` }
// Set #blah's 'size' attribute to the value of css variable '--size' { id:'blah', variable:'size', attribute:'size' }
The first parameter is the context for which CSS variable values are fetched
as well as for resolving query selectors. This can usually be document.body.
setFromVariables(context, ...options): void
Parameters
context: string | HTMLElement
Context element which is needed for relative querying. Otherwise use document.body
Reads the value of a CSS variable and assign it to HTML attributes or object field.
The first parameter is the context for which CSS variable values are fetched as well as for resolving query selectors. This can usually be
document.body
.