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

require("windicss/plugin/line-clamp") uniapp小程序不生效 #61

Closed
a395027720 opened this issue Aug 16, 2022 · 2 comments
Closed

require("windicss/plugin/line-clamp") uniapp小程序不生效 #61

a395027720 opened this issue Aug 16, 2022 · 2 comments

Comments

@a395027720
Copy link

1、windi.config.js配置require("windicss/plugin/line-clamp") ,样式丢失。只留了一个 overflow-hidden;
2、windi.config.js的拓展配置没有覆盖默认的。比如:
theme: {
extend: {
borderWidth: {
"2px": "2px",
}
}

实际生效后是 2rpx; 而不是2px

@ItsRyanWu
Copy link
Member

  1. 该问题应该和 Windi CSS 本身有关,需要打开 prefixer 选项来开启对浏览器前缀的支持。点击查看 Windi CSS 的 issue

@ItsRyanWu
Copy link
Member

  1. 你参考的设计稿是 350px 宽度的吗?插件其实会自动读取 Taro 的 designWidth 配置,Taro 默认的 designWidth 配置是 750 而且转换比率是 1,建议你关闭 Taro 的 pxTransform 选项,然后开启插件的 enableRpx 选项,如果你的设计稿是 350px 那么将 Taro 的 designWidth 配置改为 350 即可达到 2px 转换为 4rpx 的目的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants