update: px2rem to px2viewport

main
fadeaway 8 months ago
parent a0ace3bda9
commit e841bcbdb6

21
package-lock.json generated

@ -8,7 +8,6 @@
"name": "queyue-h5",
"version": "0.1.0",
"dependencies": {
"lib-flexible": "^0.3.2",
"next": "14.1.3",
"react": "^18",
"react-dom": "^18"
@ -31,7 +30,7 @@
"postcss": "^8",
"postcss-flexbugs-fixes": "^5.0.2",
"postcss-preset-env": "^9.5.1",
"postcss-pxtorem": "^6.1.0",
"postcss-px-to-viewport": "^1.1.1",
"prettier": "^3.2.5",
"tailwindcss": "^3.3.0",
"typescript": "^5.2.2"
@ -4543,11 +4542,6 @@
"node": ">= 0.8.0"
}
},
"node_modules/lib-flexible": {
"version": "0.3.2",
"resolved": "https://registry.npmmirror.com/lib-flexible/-/lib-flexible-0.3.2.tgz",
"integrity": "sha512-9yowMWA70tKhKdCJDaltY0mNQG4OWo7pWKScnTp9aiSxS7s20ZYlwBRE3335nweOf5qKXVC7sDxJwMPM8/MFZg=="
},
"node_modules/lilconfig": {
"version": "2.1.0",
"resolved": "https://registry.npmmirror.com/lilconfig/-/lilconfig-2.1.0.tgz",
@ -5945,13 +5939,14 @@
"postcss": "^8.4"
}
},
"node_modules/postcss-pxtorem": {
"version": "6.1.0",
"resolved": "https://registry.npmmirror.com/postcss-pxtorem/-/postcss-pxtorem-6.1.0.tgz",
"integrity": "sha512-ROODSNci9ADal3zUcPHOF/K83TiCgNSPXQFSbwyPHNV8ioHIE4SaC+FPOufd8jsr5jV2uIz29v1Uqy1c4ov42g==",
"node_modules/postcss-px-to-viewport": {
"version": "1.1.1",
"resolved": "https://registry.npmmirror.com/postcss-px-to-viewport/-/postcss-px-to-viewport-1.1.1.tgz",
"integrity": "sha512-2x9oGnBms+e0cYtBJOZdlwrFg/mLR4P1g2IFu7jYKvnqnH/HLhoKyareW2Q/x4sg0BgklHlP1qeWo2oCyPm8FQ==",
"dev": true,
"peerDependencies": {
"postcss": "^8.0.0"
"dependencies": {
"object-assign": ">=4.0.1",
"postcss": ">=5.0.2"
}
},
"node_modules/postcss-replace-overflow-wrap": {

@ -9,7 +9,6 @@
"lint": "eslint src --fix --ext .ts,.tsx,.js,.jsx --max-warnings 0"
},
"dependencies": {
"lib-flexible": "^0.3.2",
"next": "14.1.3",
"react": "^18",
"react-dom": "^18"
@ -32,7 +31,7 @@
"postcss": "^8",
"postcss-flexbugs-fixes": "^5.0.2",
"postcss-preset-env": "^9.5.1",
"postcss-pxtorem": "^6.1.0",
"postcss-px-to-viewport": "^1.1.1",
"prettier": "^3.2.5",
"tailwindcss": "^3.3.0",
"typescript": "^5.2.2"

@ -12,15 +12,22 @@ module.exports = {
'custom-properties': false,
},
},
'postcss-pxtorem': {
rootValue: 37.5,
'postcss-px-to-viewport': {
unitToConvert: 'px',
viewportWidth: 375,
unitPrecision: 5,
propList: ['*'],
viewportUnit: 'vw',
fontViewportUnit: 'vw',
selectorBlackList: [],
replace: true,
minPixelValue: 1,
mediaQuery: false,
minPixelValue: 0,
exclude: '',
replace: true,
exclude: undefined,
include: undefined,
landscape: false,
landscapeUnit: 'vw',
landscapeWidth: 568,
},
},
};

@ -1,5 +1,3 @@
import LibFlexible from '@/components/LibFlexible';
import { RegularFont } from '@/utils/font';
import type { Metadata, Viewport } from 'next';
@ -23,9 +21,7 @@ export const viewport: Viewport = {
export default function RootLayout({ children }: Readonly<{ children: React.ReactNode }>) {
return (
<html lang="zn-ch" className={RegularFont.className}>
<body>
<LibFlexible>{children}</LibFlexible>
</body>
<body>{children}</body>
</html>
);
}

@ -1,17 +0,0 @@
'use client';
import { useState, useEffect } from 'react';
export default function LibFlexible({ children }: Readonly<{ children: React.ReactNode }>) {
const [loaded, setLoaded] = useState(false);
useEffect(() => {
const setRem = async () => {
await import('lib-flexible');
setLoaded(true);
};
setRem();
}, []);
return loaded ? children : null;
}

@ -2567,11 +2567,6 @@ levn@^0.4.1:
prelude-ls "^1.2.1"
type-check "~0.4.0"
lib-flexible@^0.3.2:
version "0.3.2"
resolved "https://registry.npmmirror.com/lib-flexible/-/lib-flexible-0.3.2.tgz"
integrity sha512-9yowMWA70tKhKdCJDaltY0mNQG4OWo7pWKScnTp9aiSxS7s20ZYlwBRE3335nweOf5qKXVC7sDxJwMPM8/MFZg==
lilconfig@^2.1.0:
version "2.1.0"
resolved "https://registry.npmmirror.com/lilconfig/-/lilconfig-2.1.0.tgz"
@ -2842,7 +2837,7 @@ npm-run-path@^5.1.0:
dependencies:
path-key "^4.0.0"
object-assign@^4.0.1, object-assign@^4.1.1:
object-assign@^4.0.1, object-assign@^4.1.1, object-assign@>=4.0.1:
version "4.1.1"
resolved "https://registry.npmmirror.com/object-assign/-/object-assign-4.1.1.tgz"
integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==
@ -3349,10 +3344,13 @@ postcss-pseudo-class-any-link@^9.0.1:
dependencies:
postcss-selector-parser "^6.0.13"
postcss-pxtorem@^6.1.0:
version "6.1.0"
resolved "https://registry.npmmirror.com/postcss-pxtorem/-/postcss-pxtorem-6.1.0.tgz"
integrity sha512-ROODSNci9ADal3zUcPHOF/K83TiCgNSPXQFSbwyPHNV8ioHIE4SaC+FPOufd8jsr5jV2uIz29v1Uqy1c4ov42g==
postcss-px-to-viewport@^1.1.1:
version "1.1.1"
resolved "https://registry.npmmirror.com/postcss-px-to-viewport/-/postcss-px-to-viewport-1.1.1.tgz"
integrity sha512-2x9oGnBms+e0cYtBJOZdlwrFg/mLR4P1g2IFu7jYKvnqnH/HLhoKyareW2Q/x4sg0BgklHlP1qeWo2oCyPm8FQ==
dependencies:
object-assign ">=4.0.1"
postcss ">=5.0.2"
postcss-replace-overflow-wrap@^4.0.0:
version "4.0.0"
@ -3379,7 +3377,7 @@ postcss-value-parser@^4.0.0, postcss-value-parser@^4.2.0:
resolved "https://registry.npmmirror.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz"
integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==
postcss@^8, postcss@^8.0.0, postcss@^8.0.3, postcss@^8.1.0, postcss@^8.1.4, postcss@^8.2, postcss@^8.2.14, postcss@^8.4, postcss@^8.4.21, postcss@^8.4.23, postcss@^8.4.6, postcss@>=8.0.9:
postcss@^8, postcss@^8.0.0, postcss@^8.0.3, postcss@^8.1.0, postcss@^8.1.4, postcss@^8.2, postcss@^8.2.14, postcss@^8.4, postcss@^8.4.21, postcss@^8.4.23, postcss@^8.4.6, postcss@>=5.0.2, postcss@>=8.0.9:
version "8.4.35"
resolved "https://registry.npmmirror.com/postcss/-/postcss-8.4.35.tgz"
integrity sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==

Loading…
Cancel
Save