This PR introduced a new option css.unit in goji.config.js to enable CSS unit transforming.
css.unit
Type: undefined | 'keep' | 'to-px' | 'to-rpx'
Default: 'to-rpx'
There is a built-in PostCSS plugin called postcss-transform-unit that can be used to transform CSS
units in all files. In some cases, you may want to convert the usage of px to rpx or vice versa.
You can use this option.
keep: Do not transform any CSS unit.
to-px: Transform rpx to px. 2rpx equals to 1px.
to-rpx: Transform px to rpx. 1px equals to 2rpx.
The default will be changed to keep in the future.
This PR introduced a new option
css.unit
ingoji.config.js
to enable CSS unit transforming.css.unit
Type:
undefined | 'keep' | 'to-px' | 'to-rpx'
Default:
'to-rpx'
There is a built-in PostCSS plugin called
postcss-transform-unit
that can be used to transform CSS units in all files. In some cases, you may want to convert the usage ofpx
torpx
or vice versa. You can use this option.keep
: Do not transform any CSS unit.to-px
: Transformrpx
topx
.2rpx
equals to1px
.to-rpx
: Transformpx
torpx
.1px
equals to2rpx
.