postcss-custom-unit

1.0.0 • Public • Published

PostCSS Custom Unit Build Status

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' }}]
        })
    ]
})

Package Sidebar

Install

npm i postcss-custom-unit

Weekly Downloads

114

Version

1.0.0

License

MIT

Unpacked Size

4.07 kB

Total Files

5

Last publish

Collaborators

  • yanhaijing