index.scss 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. @import '@/uni_modules/lime-ui/style/index.scss';
  2. $name: l-slider;
  3. $fill-3: var(--l-fill-3, rgba(0, 0, 0, 0.04));
  4. $brand-color: var(--l-brand-color, #1677ff);
  5. $brand-color-disabled: var(--l-brand-color-disabled, $primary-color-3);
  6. $border-radius-round: var(--l-border-radius-round, 999px);
  7. $shadow-1: var(
  8. --l-shadow-1,
  9. 0 1px 10px rgba(0, 0, 0, 5%),
  10. 0 4px 5px rgba(0, 0, 0, 8%),
  11. 0 2px 4px -1px rgba(0, 0, 0, 12%)
  12. );
  13. $slider-rail-size: var(--l-slider-rail-size, 4px);
  14. $slider-rail-color: var(--l-slider-rail-color, $fill-3);
  15. $slider-track-color: var(--l-slider-track-color, $brand-color);
  16. $slider-disabled-color: var(--l-slider-disabled-color, $brand-color-disabled);
  17. $slider-dot-size: var(--l-slider-dot-size, 20px);
  18. $slider-dot-color: var(--l-slider-dot-color, white);
  19. $slider-dot-radius: var(--l-slider-dot-radius, 50%);
  20. .#{$name} {
  21. font-size: 14px;
  22. &--horizontal {
  23. &.#{$name}-with-marks {
  24. padding-bottom: 20px;
  25. }
  26. .#{$name} {
  27. &--default {
  28. margin: calc(($slider-dot-size - $slider-rail-size) / 2) calc(($slider-dot-size) / 2);
  29. }
  30. &__rail,&__track {
  31. height: $slider-rail-size;
  32. top: 0;
  33. }
  34. &__dot {
  35. &--left {
  36. left: 0;
  37. transform: translate3d(-50%, -50%, 0);
  38. }
  39. &--right {
  40. right: 0;
  41. transform: translate3d(50%, -50%, 0);
  42. }
  43. }
  44. &__mark {
  45. &-item {
  46. position: absolute;
  47. height: 8px;
  48. width: 8px;
  49. border-radius: 50%;
  50. top: 50%;
  51. margin-top: -4px;
  52. z-index: 1;
  53. background-color: $slider-rail-color;
  54. transform: translateX(-50%);
  55. }
  56. &-active {
  57. background-color: $slider-track-color;
  58. }
  59. &-text {
  60. position: absolute;
  61. left: 50%;
  62. color: #000000e6;
  63. transform: translate(-50%);
  64. top: 16px;
  65. }
  66. }
  67. }
  68. }
  69. &__inner {
  70. position: relative;
  71. }
  72. &__rail {
  73. background-color: $slider-rail-color;
  74. border-radius: $border-radius-round;
  75. }
  76. &__track {
  77. position: absolute;
  78. width: 10%;
  79. border-radius: $border-radius-round;
  80. background-color: $slider-track-color;
  81. z-index: 2;
  82. }
  83. &__dot {
  84. position: absolute;
  85. top: 50%;
  86. // left: 10%;
  87. // transform: translate3d(-50%,-50%,0);
  88. width: $slider-dot-size;
  89. height: $slider-dot-size;
  90. background-color: $slider-dot-color;
  91. border-radius: $slider-dot-radius;
  92. box-shadow: $shadow-1;
  93. }
  94. &--disabled {
  95. .#{$name} {
  96. &__track, &__mark-active {
  97. background-color: $slider-disabled-color;
  98. }
  99. }
  100. }
  101. }