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

switch override部分css后过渡动画消失 #2938

Closed
howlwindy opened this issue May 13, 2022 · 1 comment
Closed

switch override部分css后过渡动画消失 #2938

howlwindy opened this issue May 13, 2022 · 1 comment
Labels
feature request New feature or request

Comments

@howlwindy
Copy link

howlwindy commented May 13, 2022

TuSimple/naive-ui version (版本)

2.28.4

Vue version (Vue 版本)

3.2.33

Browser and its version (浏览器及其版本)

101.0.4951.64

System and its version (系统及其版本)

MacOS(12.3.1)

Node version (Node 版本)

Reappearance link (重现链接)

https://www.naiveui.com/zh-CN/light/components/switch

Reappearance steps (重现步骤)

{
  "Switch": {
    "railColor": "rgba(6, 6, 6, 0.14)",
    "buttonColor": "#FFFFFFFF",
    "buttonWidthSmall": ".875rem",
    "buttonWidthMedium": "1.125rem",
    "buttonWidthLarge": "1.375rem",
    "buttonWidthPressedSmall": "1.25rem",
    "buttonWidthPressedMedium": "1.5rem",
    "buttonWidthPressedLarge": "1.75rem",
    "railWidthSmall": "2rem",
    "railWidthMedium": "2.5rem",
    "railWidthLarge": "3rem",
    "railBorderRadiusSmall": ".1875rem",
    "railBorderRadiusMedium": ".1875rem",
    "railBorderRadiusLarge": ".1875rem",
    "buttonBorderRadiusSmall": ".1875rem",
    "buttonBorderRadiusMedium": ".1875rem",
    "buttonBorderRadiusLarge": ".1875rem"
  }
}

在文档中的themeEditor导入上面的JSON,没有输入的地方给个其他的值,然后切换switch,这时候过渡动画消失

我测试是buttonHeightSmall, buttonHeightMedium, buttonHeightLarge, railHeightSmall, railHeightMedium, railHeightLarge这6个值的问题

Expected results (期望的结果)

修复bug

Actual results (实际的结果)

过渡动画消失,其实在本地测试时,查看chrome-elements时发现--n-width:NaNpx;--n-height:NaNpx;--n-offset:NaNpx;导致样式改变,button移出rail

Remarks (补充说明)

@github-actions github-actions bot added the untriaged need to sort label May 13, 2022
@07akioni
Copy link
Collaborator

switch 依赖于像素运算,我不确保最终可以支持非 px 的属性,会尝试一下

@07akioni 07akioni added feature request New feature or request and removed untriaged need to sort labels May 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants