npm.io
1.0.0 • Published 9 years ago

prejss-styles-loader

Licence
MIT
Version
1.0.0
Deps
1
Vulns
0
Weekly
0
Stars
8

prejss-styles-loader

Styles loader for Webpack on top of PreJSS.

Process stylesheets from separate files via PostCSS to the JSS-like objects.

Installation

npm i -D prejss-styles-loader

or

yarn add -D prejss-styles-loader

Usage example

import injectSheet from 'react-jss'

// this style would become to JSS object literal
import style from './style.sss'

const App = () => // ...

// ...

export default injectSheet(style)(App)

styles.sss

.app
  position: absolute
  top: 0
  left: 0
Webpack config example
rules: [{
  test: /\.s[ac]?ss$/,
  include: [
    PATHS.app,
  ],
  use: [
    'prejss-styles-loader',
  ],
}]

License

MIT