evrone / postcss-px-to-viewport

A plugin for PostCSS that generates viewport units (vw, vh, vmin, vmax) from pixel units. The best choice to create a scalable interface on different displays by one design size.
https://evrone.com/postcss-px-viewport
MIT License
3.04k stars 406 forks source link

feature: support multi units 支持设置多个自定义单位或规则 #77

Open TAUnionOtto opened 3 years ago

TAUnionOtto commented 3 years ago

Support mulit multipleunits like: 支持设置多个自定义单位:

[
  {
    unitToConvert: 'rpx',
    viewportWidth: 750,
    viewportUnit: 'vw',
    minPixelValue: 0
  }, {
    unitToConvert: 'dpx',
    viewportWidth: 1920,
    viewportUnit: 'vw',
    minPixelValue: 0
  }
]

At the same time, added tests and documents related to this part of the function. 同时添加了这部分功能相关的测试和文档。

Test

image

Environment 测试环境:

Issues

75

gonnavis commented 3 years ago

Thank you for your pr! I really need this feature!

Gala-1024 commented 2 years ago

你好,请问这个能用了吗?