A PostCSS plugin that injects a JavaScript object as CSS custom properties into the :root selector.
This makes it possible to manage variables with JavaScript when using CSS Variables.
npm install postcss-import-object --save-devimport postcss from 'postcss'
import importObject from 'postcss-import-object'
postcss([importObject({
'--foo': 'bar',
'--baz': 'foobar'
})])
.process(input, { from: undefined })
.then(result => {
// The argument object is injected into :root.
// :root {
// --foo: bar;
// --baz: foobar;
// }
})MIT