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

在rem2rpx模式下border-width属性未正常转换单位 #18

Open
3 of 4 tasks
EthanZhong opened this issue Apr 25, 2024 · 2 comments
Open
3 of 4 tasks

在rem2rpx模式下border-width属性未正常转换单位 #18

EthanZhong opened this issue Apr 25, 2024 · 2 comments

Comments

@EthanZhong
Copy link

EthanZhong commented Apr 25, 2024

描述问题

presetUni({
      remRpx: {
        baseFontSize: 4,
        screenWidth: 750,
        mode: 'rem2rpx'
      },
      attributify: {
        prefixedOnly: true,
        prefix: 'un-'
      }
    })

按此配置绝大部分样式可以正常转换为rpx单位,但和borderWidth相关的却是px

复现

<view class="w-20 b-2"></view>
.w-20{
 width:20rpx;
}

.b-2{
  border-width:2px;
}

系统信息

基础环境信息:

  • os: macOS 14.4
  • node: 20.11.1
  • vscode: 1.88.1
  • volar: 2.0.14

基础依赖信息:

  • vue: 3.4.21
  • vite: 4.3.5
  • @dcloudio/uni-app: 3.0.0-4000820240401001

使用的包管理器

pnpm

核对

  • 遵循我们的 行为准则
  • 检查是否已经有一个报告相同错误的问题,以避免重复创建。
  • 这是一个具体的错误。请开启 GitHub 讨论你的疑问。
  • 所提供的复现是这个问题的 最小复现
@Skiyee
Copy link
Member

Skiyee commented May 15, 2024

这是 unocss 的约定,插件也遵循原本的约定
请用指定单位代替,如:b-2px|b-2rpx

@ModyQyW
Copy link
Member

ModyQyW commented May 17, 2024

@zguolee cc?

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