JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 120
  • Score
    100M100P100Q71781F
  • License MIT

Webpack loader for compiling atomic css

Package Exports

  • webpack-atomizer-loader

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (webpack-atomizer-loader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

npm version Build Status

webpack-atomizer-loader

Webpack loader for compiling atomic css

Install

$ npm install webpack-atomizer-loader --save-dev

Usage

In your webpack config:

  1. find the babel-loader or jsx-loader setting
  2. insert the webpack-atomizer-loader before it
  3. example
loaders: [
        {
            test: /\.jsx?$/,
            exclude: /(node_modules)/,
            loader: 'webpack-atomizer-loader?configPath=' + __dirname + '/atomCssConfig.js!babel-loader',
        }
    ]
  1. atomCssConfig.js example which specified in configPath
module.exports = {
    cssDest: './main.css',
    options: {
        namespace: '#atomic',
    },
    configs: {
        breakPoints: {
            sm: '@media screen(min-width=750px)',
            md: '@media(min-width=1000px)',
            lg: '@media(min-width=1200px)'
        },
        custom: {
            '1': '1px solid #000',
        },
        classNames: []
    }
}

To assign the output destination, the extra parameter cssDest in atomic's config should be set, if bypass configPath, the default cssDest is ./build/css/atomic.css.

Please visit acss-io/atomizer for more information.