Skip to content

usagi-f/postcss-import-object

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

postcss-import-object

If you pass an object as an argument, a new ROOT selector will be created and injected into it.

This makes it possible to manage variables with JavaScript when using CSS Variables.

For example Immutable.js makes it easier to inject external objects into the CSS.

Installation

npm install postcss-import-object --save-dev
yarn add postcss-import-object --dev

Usage

var importObject = require('postcss-import-object')

postcss([importObject({
        '--foo': 'bar',
        '--baz': 'foobar'
    })])
    .process(input)
    .then(result => {
        // argument object is injected into a :root.
        // :root {
        //     --foo: bar;
        //     --baz: foobar;
        // }
    })

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published