babel-plugin-import-css-to-jss

3.1.1 • Public • Published

This is a simple babel plugin to inline css into js vis jss.

This plugin is very much experimental due to use of the Babel6 API - largely undocumented. Contributions are welcome.

Usage

The following command will convert everything in the src folder to lib using babel and our plugin.

babel src/ -d lib/ --presets stage-0,es2015,react --plugins import-css-to-jss

Every js file that has a statement such as:

import styles from './styles.css'

will be roughtly translated to:

var styles = {
    // the css file converted to JSS
}

Use Cases

The only use case of this plugin is to be able to bundle css styles with your js components. It is good for portability.

Readme

Keywords

Package Sidebar

Install

npm i babel-plugin-import-css-to-jss

Weekly Downloads

100

Version

3.1.1

License

MIT

Unpacked Size

4.47 kB

Total Files

6

Last publish

Collaborators

  • wsmaster