index-pure.less 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. @import '../../style/themes/index';
  2. @import '../../style/mixins/index';
  3. @slider-prefix-cls: ~'@{ant-prefix}-slider';
  4. .@{slider-prefix-cls} {
  5. .reset-component();
  6. position: relative;
  7. height: 12px;
  8. margin: @slider-margin;
  9. padding: 4px 0;
  10. cursor: pointer;
  11. touch-action: none;
  12. .vertical();
  13. &-with-marks {
  14. margin-bottom: 28px;
  15. }
  16. &-rail {
  17. position: absolute;
  18. width: 100%;
  19. height: 4px;
  20. background-color: @slider-rail-background-color;
  21. border-radius: @border-radius-base;
  22. transition: background-color 0.3s;
  23. }
  24. &-track {
  25. position: absolute;
  26. height: 4px;
  27. background-color: @slider-track-background-color;
  28. border-radius: @border-radius-base;
  29. transition: background-color 0.3s;
  30. }
  31. &-handle {
  32. position: absolute;
  33. width: @slider-handle-size;
  34. height: @slider-handle-size;
  35. margin-top: @slider-handle-margin-top;
  36. background-color: @slider-handle-background-color;
  37. border: solid @slider-handle-border-width @slider-handle-color;
  38. border-radius: 50%;
  39. box-shadow: @slider-handle-shadow;
  40. cursor: pointer;
  41. transition: border-color 0.3s, box-shadow 0.6s,
  42. transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  43. &-dragging&-dragging&-dragging {
  44. border-color: @slider-handle-color-focus;
  45. box-shadow: 0 0 0 5px @slider-handle-color-focus-shadow;
  46. }
  47. &:focus {
  48. border-color: @slider-handle-color-focus;
  49. outline: none;
  50. box-shadow: 0 0 0 5px @slider-handle-color-focus-shadow;
  51. }
  52. &.@{ant-prefix}-tooltip-open {
  53. border-color: @slider-handle-color-tooltip-open;
  54. }
  55. }
  56. &:hover {
  57. .@{slider-prefix-cls}-rail {
  58. background-color: @slider-rail-background-color-hover;
  59. }
  60. .@{slider-prefix-cls}-track {
  61. background-color: @slider-track-background-color-hover;
  62. }
  63. .@{slider-prefix-cls}-handle:not(.@{ant-prefix}-tooltip-open) {
  64. border-color: @slider-handle-color-hover;
  65. }
  66. }
  67. &-mark {
  68. position: absolute;
  69. top: 14px;
  70. left: 0;
  71. width: 100%;
  72. font-size: @font-size-base;
  73. }
  74. &-mark-text {
  75. position: absolute;
  76. display: inline-block;
  77. color: @text-color-secondary;
  78. text-align: center;
  79. word-break: keep-all;
  80. cursor: pointer;
  81. user-select: none;
  82. &-active {
  83. color: @text-color;
  84. }
  85. }
  86. &-step {
  87. position: absolute;
  88. width: 100%;
  89. height: 4px;
  90. background: transparent;
  91. }
  92. &-dot {
  93. position: absolute;
  94. top: -2px;
  95. width: 8px;
  96. height: 8px;
  97. margin-left: -4px;
  98. background-color: @component-background;
  99. border: 2px solid @slider-dot-border-color;
  100. border-radius: 50%;
  101. cursor: pointer;
  102. &:first-child {
  103. margin-left: -4px;
  104. }
  105. &:last-child {
  106. margin-left: -4px;
  107. }
  108. &-active {
  109. border-color: @slider-dot-border-color-active;
  110. }
  111. }
  112. &-disabled {
  113. cursor: not-allowed;
  114. .@{slider-prefix-cls}-rail {
  115. background-color: @slider-rail-background-color !important;
  116. }
  117. .@{slider-prefix-cls}-track {
  118. background-color: @slider-disabled-color !important;
  119. }
  120. .@{slider-prefix-cls}-handle,
  121. .@{slider-prefix-cls}-dot {
  122. background-color: @component-background;
  123. border-color: @slider-disabled-color !important;
  124. box-shadow: none;
  125. cursor: not-allowed;
  126. }
  127. .@{slider-prefix-cls}-mark-text,
  128. .@{slider-prefix-cls}-dot {
  129. cursor: not-allowed !important;
  130. }
  131. }
  132. }
  133. .vertical() {
  134. &-vertical {
  135. width: 12px;
  136. height: 100%;
  137. margin: 6px 10px;
  138. padding: 0 4px;
  139. .@{slider-prefix-cls}-rail {
  140. width: 4px;
  141. height: 100%;
  142. }
  143. .@{slider-prefix-cls}-track {
  144. width: 4px;
  145. }
  146. .@{slider-prefix-cls}-handle {
  147. margin-top: -6px; // we chould consider border width as well: (10 + 2 ) / 2
  148. margin-left: -5px;
  149. }
  150. .@{slider-prefix-cls}-mark {
  151. top: 0;
  152. left: 12px;
  153. width: 18px;
  154. height: 100%;
  155. }
  156. .@{slider-prefix-cls}-mark-text {
  157. left: 4px;
  158. white-space: nowrap;
  159. }
  160. .@{slider-prefix-cls}-step {
  161. width: 4px;
  162. height: 100%;
  163. }
  164. .@{slider-prefix-cls}-dot {
  165. top: auto;
  166. left: 2px;
  167. margin-bottom: -4px;
  168. }
  169. }
  170. &-tooltip {
  171. // https://github.com/ant-design/ant-design/issues/20014
  172. .@{ant-prefix}-tooltip-inner {
  173. min-width: unset;
  174. }
  175. }
  176. }
  177. @import './rtl';