This is a first step of going from a relatively human-friendly simple array format
into setting HTML attributes based on a CSS variable. The second step is to call setFromVariables
// Array of arrays is treated as a set of key-value pairs constoptions = [ [`indicator-fill`, `gray`], [`backdrop-fill`, `whitesmoke`] ] constattrs = parseAsAttributes(options); Yields: [ { variable:`indicator-fill`, attribute:`fill`, id:`indicator`, defaultValue:`gray` } { variable:`backdrop-fill`, attribute:`fill`, id:`backdrop`, defaultValue:`whitesmoke` } ]
Parse data as attributes.
This is a first step of going from a relatively human-friendly simple array format into setting HTML attributes based on a CSS variable. The second step is to call
setFromVariables