rework-namespace-at
v1.2.0
Published
Hijacks the @namespace rule as a selector prefix decorator.
Downloads
8
Readme
rework-namespace-at
A rework plugin that hijacks the @namespace rule as a selector prefix decorator. Because who uses @namespace anyway?
This is obviously a hack.
Install
npm install rework-namespace-at
Usage
var namespace = require('rework-namespace-at');
var str = 'your css here';
var css = new rework(str).use(namespace()).toString();
console.log(css);
Results
Before:
@namespace .some-prefix;
$namespace {
margin: 10px;
}
$namespace.foo {
padding: 10px;
}
body$namespace {
background: white;
}
.bar {
color: #fff;
}
.baz {
background: green;
}
@namespace end;
After:
.some-prefix {
margin: 10px;
}
.some-prefix.foo {
padding: 10px;
}
body.some-prefix {
background: white;
}
.some-prefix .bar {
color: #fff;
}
.some-prefix .baz {
background: green;
}
License
MIT