postcss-px-to-viewport

    autoprefixer: {},
     'postcss-PX-to-the viewport' : { 
      unitToConvert: 'PX' , // units to be converted 
      viewportWidth: 750 , // width (Number) view 
      unitPrecision: . 3 , // (Number) designated `px` converted to decimal window unit value, default. 5 
      propList: [ '*' ], // (the Array) can be converted CSS property specifies the default is [ '*'], representative of all attributes conversion 
      viewportUnit : 'vw' , // (String) specifies the need to convert the windows unit, the default vw 
      fontViewportUnit: 'vw' , // (String) specifies the font needs to be converted into units of windows, the default vw 
      selectorBlackList: [ '.IGNORE', '.hairlines' ], // (the Array) designated unit is not converted to windows-based, reservation px, regexp or regular string value, recommended to define one or two generic class name 
      minPixelValue:1, // (Number) Default value is 1, less than or equal to `1px` not converted to window units, 
      mediaQuery: to false , // (Boolean) also query whether the media conversion at px, defaults to false 
      Replace: to true , // replace comprising vw rules, instead of adding rollback. 
      exclude: [], // (Array or Regexp) arranged to ignore the file, such as the node_modules 
      Landscape: to false , 
      landscapeUnit: 'VW' , 
      landscapeWidth: 568 
    } 
  }

If your style needs to be done to adjust the size of the viewport width, this script can put your CSS in px units into vw, 1vw equal to 1/100 of the width of the viewport.

Before doing mobile terminal adapter, which is basically rem program, now we found a new solution is to use the viewport units, now viewportthe unit is supported by a growing number of browsers

 

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/jockr/p/11608986.html