0.1.1 • Published 3 years ago

@minibag/postcss-rem-to-rpx v0.1.1

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

@minibag/postcss-rem-to-rpx

Useful plugin for converting rem values 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-rem-to-rpx')
    ]
}

Overriding the scaling behaviour

Using this configuration

type Config =
	| { type: "screen"; screenWidth: number }
	| { type: "rate"; conversionRate: number };

Example usage:

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