@opendt/less-plugin-rpx

rpx function to support wx-mini rpx unit

Usage no npm install needed!

<script type="module">
  import opendtLessPluginRpx from 'https://cdn.skypack.dev/@opendt/less-plugin-rpx';
</script>

README

less-plugin-rpx

Add rpx function to support wx-mini rpx unit.

.avatar {
  width: rpx(100);
  height: rpx(100);
  border-radius: rpx(10);
}

becomes:

.avatar {
  width: 100rpx;
  height: 100rpx;
  border-radius: 10rpx;
}

Installation

npm i @opendt/less-plugin-rpx --save-dev