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

您好,单位能全部设置为rpx吗? #116

Closed
jiang-jiang-jiang-1 opened this issue Dec 11, 2023 · 3 comments
Closed

您好,单位能全部设置为rpx吗? #116

jiang-jiang-jiang-1 opened this issue Dec 11, 2023 · 3 comments

Comments

@jiang-jiang-jiang-1
Copy link

比如mt-2,现在转换为margin-top:16rpx,能否转换为:margin-top:2rpx。

@MellowCo
Copy link
Owner

自己覆盖就行

rules: [
  [/^m-(\d)$/, ([, d]) => ({ margin: `${d}rpx` })],
],

@jiang-jiang-jiang-1
Copy link
Author

感谢您的解答

//unocss.config.ts
import { DefineConfig } from 'unocss'

export default DefineConfig({
// 其他配置项...
rules: [
[/^m-(\d)$/, ([, d]) => ({ margin: ${d}rpx})],
],
// 其他配置项项...
})

@haobarry
Copy link

好多要處理的

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

3 participants