switch.wxss 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. .t-float-left {
  2. float: left;
  3. }
  4. .t-float-right {
  5. float: right;
  6. }
  7. @keyframes tdesign-fade-out {
  8. from {
  9. opacity: 1;
  10. }
  11. to {
  12. opacity: 0;
  13. }
  14. }
  15. .hotspot-expanded.relative {
  16. position: relative;
  17. }
  18. .hotspot-expanded::after {
  19. content: '';
  20. display: block;
  21. position: absolute;
  22. left: 0;
  23. top: 0;
  24. right: 0;
  25. bottom: 0;
  26. transform: scale(1.5);
  27. }
  28. .t-switch {
  29. display: flex;
  30. align-items: center;
  31. }
  32. .t-switch__label {
  33. display: inline-block;
  34. vertical-align: middle;
  35. text-align: right;
  36. margin-right: 32rpx;
  37. font-size: 32rpx;
  38. color: rgba(0, 0, 0, 0.4);
  39. }
  40. .t-switch__body {
  41. vertical-align: middle;
  42. width: 88rpx;
  43. height: 48rpx;
  44. border-radius: 24rpx;
  45. background-color: rgba(0, 0, 0, 0.26);
  46. position: relative;
  47. }
  48. .t-switch__body--active {
  49. background-color: #0052d9;
  50. }
  51. .t-switch__body--disabled {
  52. background-color: #E7E7E7;
  53. }
  54. .t-switch__body--active.t-switch__body--disabled {
  55. background-color: #96BBF8;
  56. }
  57. .t-switch__dot {
  58. position: absolute;
  59. left: 5rpx;
  60. top: 50%;
  61. width: 40rpx;
  62. height: 40rpx;
  63. border-radius: 50%;
  64. background-color: #fff;
  65. transition: all 0.3s;
  66. transform: translateY(-50%);
  67. }
  68. .t-switch__dot--active {
  69. left: 45rpx;
  70. }