Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: uniapp 编译支付宝小程序, 会导致 scss 里面声明的px 变量自动转为 rpx #546

Open
hhcgq opened this issue Jan 6, 2025 · 1 comment
Assignees

Comments

@hhcgq
Copy link

hhcgq commented Jan 6, 2025

weapp-tailwindcss 版本

3.7.0

框架 & 小程序平台

uni-app vue2 webpack5 支付宝

最小复现bug的代码仓库链接

No response

复现bug的步骤

lQLPJwqi4AXYmxVwzQFpsPhJrrNzkmDBB2BfoD0vFwA_361_112
lQLPKGKmKBQXixVPzQFMsFqs5gmYWezcB2BfoD0vFwE_332_79

参照 demo里的 uniapp webpack5 vue2 配置,在声明 scss变量时会把 px单位自动转为 rpx

预期是什么?

px 要么✖️2 转为 rpx 要么就不转

实际发生了什么?

16px 直接转为 16rpx

运行环境

No response

其他附加信息

No response

@hhcgq hhcgq added the bug Something isn't working label Jan 6, 2025
@sonofmagic
Copy link
Owner

我在 https://github.com/icebreaker-template/uni-app-vue2-tailwind-vscode-template/tree/issues/546 这个分支,使用了你这个 case,构建到支付宝小程序。没有出现你这个情况。
image
QQ_1736228470662

你可以看看你的 dist/build/mp-alipay/common/main.acss 里面,到底是 px 还是 rpx
另外我也怀疑你安装了其他的 postcss 插件(比如 postcss-pxtransform),导致你出现了 px 转化成 rpx 的行为
你看看是否出现我所说的情况 @hhcgq

@sonofmagic sonofmagic added need more info and removed bug Something isn't working labels Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants