@alitajs/hd

umi 移动端的适配方案

Usage no npm install needed!

<script type="module">
  import alitajsHd from 'https://cdn.skypack.dev/@alitajs/hd';
</script>

README

@alitajs/hd

Hd plugin for umi.

Usage

// .umirc.ts
export default {
  plugins: ['@alitajs/hd'],
  hd: {
    px2rem: {
      selectorDoubleRemList: [/.ant-/],
    },
  },
};

hd more options:

{
  // same as config.theme, default set @hd: 2px
  "theme": {},
  "px2rem": {
    "rootValue": 100,
    "unitPrecision": 5,
    "propWhiteList": [],
    "propBlackList": [],
    "exclude": false,
    "selectorBlackList": [],
    "selectorDoubleRemList": [/.ant-/],
    "ignoreIdentifier": false,
    "replace": true,
    "mediaQuery": false,
    "minPixelValue": 0
  }
}