Skip to content

shinken008/postcss-crossplatformcomments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Why

Taro 关闭 pxtransform 时,跨平台样式注释失效,NervJS/taro#11296

Install

yarn add postcss-crossplatformcomments

Usage

taro build

postcss: {
    pxtransform: {
        enable: false,
        config: {}
    },
    'postcss-crossplatformcomments': {
        enable: true,
        config: {
          platform: process.env.TARO_ENV // rn|h5|weapp
        }
    }
     
}

postcss plugin

postcss([
    // autoprefixer({
    //     overrideBrowserslist: 'iOS >= 10, Chrome >= 49'
    // }),
    crossplatformcomments({ platform: ['h5'] }) // or platform: 'h5'
])

options

  • platform can be a string or array. If you want config mutiple platforms then platform option must be a array like platform: ['h5', 'weapp'].

About

A postcss plugin for cross-platform

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published