slider.scss 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. @mixin borderBox {
  2. box-sizing: border-box;
  3. -webkit-tap-highlight-color: rgba(0, 0, 0, 0); // remove tap highlight color for mobile safari
  4. * {
  5. box-sizing: border-box;
  6. -webkit-tap-highlight-color: rgba(0, 0, 0, 0); // remove tap highlight color for mobile safari
  7. }
  8. }
  9. .molstar-slider-base {
  10. position: relative;
  11. height: 14px;
  12. padding: 5px 0;
  13. width: 100%;
  14. border-radius: $slider-border-radius-base;
  15. @include borderBox;
  16. &-rail {
  17. position: absolute;
  18. width: 100%;
  19. background-color: $border-color;
  20. height: 4px;
  21. border-radius: 2px;
  22. }
  23. &-track {
  24. position: absolute;
  25. left: 0;
  26. height: 4px;
  27. border-radius: $slider-border-radius-base;
  28. background-color: tint($font-color, 60%);
  29. }
  30. &-handle {
  31. position: absolute;
  32. margin-left: -11px;
  33. margin-top: -9px;
  34. width: 22px;
  35. height: 22px;
  36. cursor: pointer;
  37. border-radius: 50%;
  38. background-color: $font-color;
  39. border: 4px solid $border-color;
  40. &:hover {
  41. background-color: $hover-font-color;
  42. }
  43. }
  44. &-mark {
  45. position: absolute;
  46. top: 18px;
  47. left: 0;
  48. width: 100%;
  49. font-size: 12px;
  50. }
  51. &-mark-text {
  52. position: absolute;
  53. display: inline-block;
  54. vertical-align: middle;
  55. text-align: center;
  56. cursor: pointer;
  57. color: #999;
  58. &-active {
  59. color: #666;
  60. }
  61. }
  62. &-step {
  63. position: absolute;
  64. width: 100%;
  65. height: 4px;
  66. background: transparent;
  67. }
  68. &-dot {
  69. position: absolute;
  70. bottom: -2px;
  71. margin-left: -4px;
  72. width: 8px;
  73. height: 8px;
  74. border: 2px solid #e9e9e9;
  75. background-color: #fff;
  76. cursor: pointer;
  77. border-radius: 50%;
  78. vertical-align: middle;
  79. &:first-child {
  80. margin-left: -4px;
  81. }
  82. &:last-child {
  83. margin-left: -4px;
  84. }
  85. &-active {
  86. border-color: tint($font-color, 50%);
  87. }
  88. }
  89. &-disabled {
  90. background-color: #e9e9e9;
  91. .molstar-slider-base-track {
  92. background-color: $slider-disabledColor;
  93. }
  94. .molstar-slider-base-handle, .molstar-slider-base-dot {
  95. border-color: $slider-disabledColor;
  96. background-color: #fff;
  97. cursor: not-allowed;
  98. }
  99. .molstar-slider-base-mark-text, .molstar-slider-base-dot {
  100. cursor: not-allowed!important;
  101. }
  102. }
  103. }
  104. .molstar-slider-base-vertical {
  105. width: 14px;
  106. height: 100%;
  107. padding: 0 5px;
  108. .molstar-slider-base {
  109. &-rail {
  110. height: 100%;
  111. width: 4px;
  112. }
  113. &-track {
  114. left: 5px;
  115. bottom: 0;
  116. width: 4px;
  117. }
  118. &-handle {
  119. margin-left: -5px;
  120. margin-bottom: -7px;
  121. }
  122. &-mark {
  123. top: 0;
  124. left: 18px;
  125. height: 100%;
  126. }
  127. &-step {
  128. height: 100%;
  129. width: 4px;
  130. }
  131. &-dot {
  132. left: 2px;
  133. margin-bottom: -4px;
  134. &:first-child {
  135. margin-bottom: -4px;
  136. }
  137. &:last-child {
  138. margin-bottom: -4px;
  139. }
  140. }
  141. }
  142. }