index.wxss 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. @keyframes loading-rotate {
  2. 100% {
  3. transform: rotate(1turn);
  4. }
  5. }
  6. .ant-switch {
  7. display: inline-block;
  8. vertical-align: middle;
  9. box-sizing: border-box;
  10. position: relative;
  11. align-self: center;
  12. min-width: 51px;
  13. height: 31px;
  14. border: 2px solid #eeeeee;
  15. border-radius: 15.5px;
  16. background: #ffffff;
  17. overflow: hidden;
  18. line-height: 31px;
  19. }
  20. .ant-switch-checked {
  21. background: #1677ff;
  22. border-color: #1677ff;
  23. }
  24. .ant-switch-checked .ant-switch-handle {
  25. left: calc(100% - (31px - 2 * 2px));
  26. }
  27. .ant-switch-checked .ant-switch-inner {
  28. color: #ffffff;
  29. justify-content: flex-start;
  30. }
  31. .ant-switch-disabled {
  32. opacity: 0.4;
  33. pointer-events: none;
  34. }
  35. .ant-switch-loading {
  36. pointer-events: none;
  37. }
  38. .ant-switch-loading ant-icon {
  39. animation: loading-rotate 1s linear infinite;
  40. font-size: 10px;
  41. line-height: 1;
  42. }
  43. .ant-switch-loading-icon {
  44. font-size: 10px;
  45. color: #1677ff;
  46. }
  47. .ant-switch-handle {
  48. display: flex;
  49. justify-content: center;
  50. align-items: center;
  51. width: 27px;
  52. height: 27px;
  53. border-radius: 50%;
  54. background: #ffffff;
  55. position: absolute;
  56. top: 0;
  57. left: 0;
  58. transition: all 200ms;
  59. box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.2), 0 2px 11.5px 0 rgba(0, 0, 0, 0.08), -1px 2px 2px 0 rgba(0, 0, 0, 0.1);
  60. }
  61. .ant-switch-inner {
  62. position: relative;
  63. display: flex;
  64. justify-content: flex-end;
  65. align-items: center;
  66. height: 100%;
  67. color: #999999;
  68. transition: margin 200ms;
  69. font-size: 15px;
  70. padding: 0 7px;
  71. min-width: 54px;
  72. box-sizing: border-box;
  73. }
  74. .ant-switch-inner:empty {
  75. display: none;
  76. }
  77. .ant-switch-small {
  78. min-width: 36px;
  79. height: 21px;
  80. border-radius: 10.5px;
  81. }
  82. .ant-switch-small .ant-switch-handle {
  83. width: 17px;
  84. height: 17px;
  85. }
  86. .ant-switch-small .ant-switch-inner {
  87. font-size: 8px;
  88. padding: 0 5px;
  89. min-width: 36px;
  90. }
  91. .ant-switch-small.ant-switch-checked .ant-switch-handle {
  92. left: calc(100% - (21px - 2 * 2px));
  93. }
  94. .ant-switch-x-small {
  95. min-width: 26px;
  96. height: 16px;
  97. border-radius: 8px;
  98. }
  99. .ant-switch-x-small .ant-switch-handle {
  100. width: 12px;
  101. height: 12px;
  102. }
  103. .ant-switch-x-small .ant-switch-inner {
  104. font-size: 5px;
  105. padding: 0 3px;
  106. min-width: 28px;
  107. }
  108. .ant-switch-x-small.ant-switch-checked .ant-switch-handle {
  109. left: calc(100% - (16px - 2 * 2px));
  110. }