upload project source code

This commit is contained in:
2026-04-30 18:49:43 +08:00
commit 9b394ba682
2277 changed files with 660945 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
// PostCSS 插件:将 rpx 单位转换为 vw
// 基于 750px 设计稿1rpx = 100vw / 750 = 0.1333vw
const postcssRpxToVw = () => {
return {
postcssPlugin: 'postcss-rpx-to-vw',
Declaration(decl) {
if (decl.value.includes('rpx')) {
decl.value = decl.value.replace(/(\d+(?:\.\d+)?)rpx/g, (match, num) => {
const vw = (parseFloat(num) / 750 * 100).toFixed(4);
return `${vw}vw`;
});
}
}
};
};
postcssRpxToVw.postcss = true;
export default postcssRpxToVw;