Parses input in the form of: ['elementid-attribute', 'default-value']. Eg, ['indicator-fill', 'gray'] will yield:
['elementid-attribute', 'default-value']
['indicator-fill', 'gray']
{ variable: `indicator-fill`, attribute: `fill`, id: `indicator`, defaultValue: `gray` } Copy
{ variable: `indicator-fill`, attribute: `fill`, id: `indicator`, defaultValue: `gray` }
Once parsed, use setFromVariables to apply data.
// Array of arrays is treated as a set of key-value pairsconst options = [ [`indicator-fill`, `gray`], [`backdrop-fill`, `whitesmoke`] ]const attrs = parseAsAttributes(options);Yields:[ { variable: `indicator-fill`, attribute: `fill`, id: `indicator`, defaultValue: `gray` } { variable: `backdrop-fill`, attribute: `fill`, id: `backdrop`, defaultValue: `whitesmoke` }]// AssignsetFromCssVariables(document.body, attrs); Copy
// Array of arrays is treated as a set of key-value pairsconst options = [ [`indicator-fill`, `gray`], [`backdrop-fill`, `whitesmoke`] ]const attrs = parseAsAttributes(options);Yields:[ { variable: `indicator-fill`, attribute: `fill`, id: `indicator`, defaultValue: `gray` } { variable: `backdrop-fill`, attribute: `fill`, id: `backdrop`, defaultValue: `whitesmoke` }]// AssignsetFromCssVariables(document.body, attrs);
Parses input in the form of:
['elementid-attribute', 'default-value']
. Eg,['indicator-fill', 'gray']
will yield:Once parsed, use setFromVariables to apply data.