variables.scss 5.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // Other
  2. $spacing-switch_unchecked-translateX: 2px; // 未选中开关右侧偏移量
  3. $motion-switch_spin_unchecked-translateX: 2px; // 未选中开关加载图标右侧偏移量 - 动画用
  4. $motion-switch_checked-translateX: 18px; // 选中开关右侧偏移量
  5. $motion-switch_spin_checked-translateX: 16px; // 选中开关加载图标右侧偏移量
  6. $motion-switch_expand_large-translateX: 10px;
  7. $motion-switch_unchecked_large-translateX: 3px;
  8. $motion-switch_spin_unchecked_large-translateX: 2px;
  9. $motion-switch_checked_large-translateX: 26px; // 大尺寸选中开关右侧偏移量
  10. $motion-switch_spin_checked_large-translateX: 22px; // 大尺寸选中开关加载图标右侧偏移量
  11. $motion-switch_expand_small-translateX: 2px;
  12. $motion-switch_unchecked_small-translateX: 1px;
  13. $motion-switch_spin_unchecked_small-translateX: 2px;
  14. $motion-switch_checked_small-translateX: 11px; // 小尺寸选中开关右侧偏移量
  15. $motion-switch_spin_checked_small-translateX: 10px; // 小尺寸选中开关加载图标右侧偏移量
  16. $motion-switch-transitionDuration: 200ms; // 开关动画时长
  17. // Color
  18. $color-switch_default-bg-default: var(--semi-color-fill-0); // 关闭态开关背景色 - 默认
  19. $color-switch_default-bg-hover: var(--semi-color-fill-1); // 关闭态开关背景色 - 悬浮
  20. $color-switch_default-bg-active: var(--semi-color-fill-2); // 关闭态开关背景色 - 按下
  21. $color-switch_default-border-default: transparent; // 关闭态开关描边颜色
  22. $color-switch_checked-bg-default: var(--semi-color-success); // 开启态开关背景色 - 默认
  23. $color-switch_checked-bg-hover: var(--semi-color-success-hover); // 开启态开关背景色 - 悬浮
  24. $color-switch_checked-bg-active: var(--semi-color-success-active); // 开启态开关背景色 - 按下
  25. $color-switch_disabled-bg-default: transparent; // 禁用态开关背景色
  26. $color-switch_disabled-bg-hover: transparent; // 禁用态开关背景色 - 悬浮
  27. $color-switch_disabled-bg-active: transparent; // 禁用态开关背景色 - 按下
  28. $color-switch_disabled-border-default: var(--semi-color-border); // 禁用态开关描边颜色
  29. $color-switch_disabled-bg-hover: transparent; // 禁用态开关背景色 - 悬浮
  30. $color-switch_checked_disabled-bg-default: var(--semi-color-success-disabled); // 禁用开启态开关背景颜色
  31. $color-switch_checked_disabled-border-default: transparent; // 禁用开启态开关描边颜色
  32. $color-switch_knob-bg-default: rgba(var(--semi-white), 1); // 开关按钮背景颜色
  33. $color-switch_knob-border-default: var(--semi-color-border); // 开关按钮描边颜色
  34. $color-switch_checked-text-default: var(--semi-color-white); // 开启态开关按钮文字颜色
  35. $color-switch_unchecked-text-default: var(--semi-color-text-2); // 关闭态开关按钮文字颜色
  36. $color-switch_loading_spin-default: var(--semi-color-white); // 加载态开关loading图标颜色
  37. $color-switch_spin_checked-bg-default: var(--semi-color-success-hover); // 已开启开关加载态loading背景颜色
  38. $color-switch_spin_unchecked-bg-default: var(--semi-color-fill-1); // 已关闭开关加载态loading背景颜色
  39. $color-switch_primary-outline-focus: var(--semi-color-primary-light-active); // 开关轮廓 - 聚焦
  40. // Width/Height
  41. $width-switch: 40px; // 开关宽度
  42. $height-switch: 24px; // 开关高度
  43. $width-switch_knob_expand: 6px; // 开关按钮形变宽度
  44. $width-switch_knob_default: 18px; // 开关按钮宽度
  45. $width-switch_knob_active: $width-switch_knob_default + $width-switch_knob_expand; // 开关按钮按下态宽度
  46. $height-switch_large: 32px; // 大尺寸开关高度
  47. $width-switch_large: 54px; // 大尺寸开关宽度
  48. $width-switch_knob_large: 24px; // 大尺寸开关按钮宽度
  49. $width-switch_knob_large_active: $width-switch_knob_large + $motion-switch_expand_large-translateX; // 大尺寸开关按钮按下态宽度
  50. $height-switch_small: 16px; // 小尺寸开关高度
  51. $width-switch_small: 26px; // 小尺寸开关宽度
  52. $width-switch_knob_large_small: 12px; // 小尺寸开关按钮宽度
  53. $width-switch_knob_small_active: $width-switch_knob_large_small + $motion-switch_expand_small-translateX; // 小尺寸开关按钮按下态宽度
  54. $width-switch_knob_disabled-border: 1px; // 小尺寸开关按钮宽度
  55. $width-switch_checked_unchecked_text: 26px; // 开关按钮文字宽度
  56. $width-switch_spin-small: 10px; // 小尺寸开关加载 spin 宽度
  57. $width-switch_spin-default: 18px; // 默认尺寸开关加载 spin 宽度
  58. $width-switch_spin-large: 28px; // 大尺寸开关加载 spin 宽度
  59. $width-switch-outline: 2px; // 开关轮廓宽度
  60. // Spacing
  61. $spacing-switch_knob-padding: 2px; // 开关按钮顶部边距
  62. $spacing-switch_knob_large-padding: 3px; // 大尺寸开关按钮内边距
  63. $spacing-switch_knob_small-padding: 1px; // 小尺寸开关按钮内边距
  64. $spacing-switch_knob-left: 0px; // 开关左侧偏移距离
  65. // Radius
  66. $radius-switch: $height-switch * 0.5; // 开关圆角
  67. $radius-switch_large: $height-switch_large * 0.5; // 大尺寸开关圆角
  68. $radius-switch_small: $height-switch_small * 0.5; // 小尺寸开关圆角