README
PostCSS Custom Unit
PostCSS plugin custom unit, custom convert function.
.foo {
width: 100munit;
padding: 100munit 200munit;
}
.foo {
width: 200rem;
padding: 200rem 400rem;
}
Usage
postcss([ require('postcss-custom-unit') ])
See PostCSS docs for examples for your environment.
Option
- includePath custom include path
- units custom unit and convert function
var customUnit = require("postcss-custom-unit")
module.exports = ctx => ({
plugins: [
customUnit({
includePath: /xxxx/,
units: [{ from: 'munit', convert: function (val) { return val * 2 + 'rem' }}]
})
]
})