@minibag/postcss-rem-to-rpx
v0.1.1
Published
Useful plugin for converting `rem` values to `rpx`
Downloads
1
Readme
@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
})
]
}