0.1.0 • Published 2 years ago

@miniapps-voda/postcss-to-rpx v0.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

@minibag/postcss-to-rpx

NOT YET WORKING

Useful postcss plugin to convert selected supported unit of measurements (like px, em, rem) to rpx

Where is this useful?

When building complex CSS and you don't want to think about converting to rpx

Usage

Default usage

// postcss.config.js
module.exports = {
    plugins: [
        ...,
        require('@minibag/postcss-to-rpx')
    ]
}

Overriding the scaling behaviour

Using this configuration

type Config = { units: { convert: ["px", "em"]; skip: ["rpx"] } };

Example usage:

// postcss.config.js
module.exports = {
    plugins: [
        ...,
        require('@minibag/postcss-to-rpx')({ units: { skip: ['em']}})
    ]
}