-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ✨ 增加移动端适配方案: postcss-px-to-viewport
- Loading branch information
Showing
8 changed files
with
60 additions
and
77 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module.exports = { | ||
plugins: { | ||
'postcss-px-to-viewport': { | ||
unitToConvert: 'px', // 要转化的单位 | ||
viewportWidth: 750, // 窗口宽度: UI设计稿给的手机的窗口宽度 (xx/750*100vw) | ||
viewportHeight: 1624, // 视窗的高 | ||
unitPrecision: 6, // 转换后的精度,即小数点位数 | ||
propList: ['*'], // 指定转换的css属性的单位,*代表全部css属性的单位都进行转换 | ||
viewportUnit: 'vw', // 指定需要转换成的视窗单位,默认vw | ||
fontViewportUnit: 'vw', // 指定字体需要转换成的视窗单位,默认vw | ||
selectorBlackList: [], // 指定不转换为视窗单位的类名, | ||
minPixelValue: 1, // 默认值1,小于或等于1px则不进行转换 | ||
mediaQuery: true, // 是否在媒体查询的css代码中也进行转换,默认false | ||
replace: true, // 是否转换后直接更换属性值 | ||
exclude: [/node_modules/], // 设置忽略文件,用正则做目录名匹配 | ||
landscape: false // 是否处理横屏情况 | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters