Have ideas to improve npm?Join in the discussion! »

@modular-css/shortnames

25.0.0 • Public • Published

@modular-css/shortnames NPM Version NPM License NPM Downloads

Gitter

Tiny classnames for modular-css production builds!

Install

> npm install @modular-css/shortnames

Usage

JS API

const Processor = require("@modular-css/processor");
const processor = new Processor({
    namer : require("@modular-css/shortnames")()
});
    
// ...

Browserify

build.plugin("@modular-css/browserify", {
    css   : "./style.css",
    namer : require("@modular-css/shortnames")()
});
 
// ...

Rollup

rollup({
    entry   : "./index.js",
    plugins : [
        require("@modular-css/rollup")({
            css   : "./gen/index.css",
            namer : require("@modular-css/shortnames")()
        })
    ]
});

Example output

/* one.css */
.alert {}
.notification {}
 
/* two.css */
.title {}
.heading .subheading {}

becomes

/* output.css */
.AA {}
.AB {}
 
.BA {}
.BB .BC {}

Install

npm i @modular-css/shortnames

DownloadsWeekly Downloads

33

Version

25.0.0

License

MIT

Unpacked Size

11.6 kB

Total Files

5

Homepage

m-css.com

Last publish

Collaborators

  • avatar