diff --git a/package.json b/package.json index a30a648..1999a94 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "postcss": "^8.4.16", "postcss-html": "^1.0.0", "postcss-less": "^6.0.0", - "postcss-mobile-forever": "^2.2.2", + "postcss-mobile-forever": "^3.3.1", "prettier": "^2.7.1", "rimraf": "^3.0.2", "rollup": "^2.79.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2cf0117..f06ebc4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -43,7 +43,7 @@ specifiers: postcss: ^8.4.16 postcss-html: ^1.0.0 postcss-less: ^6.0.0 - postcss-mobile-forever: ^2.2.2 + postcss-mobile-forever: ^3.3.1 prettier: ^2.7.1 qs: ^6.11.0 rimraf: ^3.0.2 @@ -121,7 +121,7 @@ devDependencies: postcss: 8.4.16 postcss-html: 1.5.0 postcss-less: 6.0.0_postcss@8.4.16 - postcss-mobile-forever: 2.2.2_postcss@8.4.16 + postcss-mobile-forever: 3.3.1_postcss@8.4.16 prettier: 2.7.1 rimraf: 3.0.2 rollup: 2.79.0 @@ -4068,8 +4068,8 @@ packages: resolution: {integrity: sha512-3sOlxmbKcSHMjlUXQZKQ06jOswE7oVkXPxmZdoB1r5l0q6gTFTQSHxNxOrCccElbW7dxNytifNEo8qidX2Vsig==} dev: true - /postcss-mobile-forever/2.2.2_postcss@8.4.16: - resolution: {integrity: sha512-biAaA41V0eiabqZ6fAykhByK+rYADUYQLg6Wvf1FcvJSEE98XRrDykSKAgrK6/+5UhIMJHBjoUJIfEouI5bhHA==} + /postcss-mobile-forever/3.3.1_postcss@8.4.16: + resolution: {integrity: sha512-NShcD9Nk0PBrFV6pghn3M6JvZOiK1AvPFvhneTOecmAmxmGn3DXJVaWcULM4tk0CtEgYLZCFY2FBDP8hhwRlnw==} peerDependencies: postcss: ^8.0.0 dependencies: diff --git a/postcss.config.js b/postcss.config.js index ac9b2dd..9a96088 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -25,15 +25,14 @@ const baseViewportOpts = { // 需要忽略的CSS选择器,不会转为视口单位,使用原有的px等单位。 // 下面配置表示类名中含有'keep-px'以及'.ignore'类都不会被转换 selectorBlackList: ['.ignore', 'keep-px'], + // 下面配置表示属性值包含 '1px solid' 的内容不会转换 + valueBlackList: ['1px solid'], // exclude: [/node_modules/], // 忽略某些文件夹下的文件或特定文件 // include: [/src/], // 如果设置了include,那将只有匹配到的文件才会被转换 border: true, // 为桌面端和横屏视图添加边框 disableDesktop: false, // 关闭桌面端适配 disableLandscape: false, // 关闭横屏适配 - mobileConfig: { - viewportUnit: 'vw', // 指定需要转换成的视口单位,建议使用 vw - fontViewportUnit: 'vw', // 字体使用的视口单位 - }, + mobileUnit: 'vw', // 指定需要转换成的视口单位,建议使用 vw }; module.exports = { diff --git a/src/styles/common.less b/src/styles/common.less index bde849e..eeb03e6 100644 --- a/src/styles/common.less +++ b/src/styles/common.less @@ -7,6 +7,7 @@ html { #app { height: 100%; width: 100%; + position: relative; } [data-theme='dark'] {