VSliderThumb.css 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. .v-slider-thumb {
  2. touch-action: none;
  3. color: rgb(var(--v-theme-surface-variant));
  4. }
  5. .v-input--error:not(.v-input--disabled) .v-slider-thumb {
  6. color: inherit;
  7. }
  8. .v-slider-thumb__label {
  9. background: rgba(var(--v-theme-surface-variant), 0.7);
  10. color: rgb(var(--v-theme-on-surface-variant));
  11. }
  12. .v-slider-thumb__label::before {
  13. color: rgba(var(--v-theme-surface-variant), 0.7);
  14. }
  15. .v-slider-thumb {
  16. outline: none;
  17. position: absolute;
  18. transition: 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);
  19. }
  20. .v-slider-thumb__surface {
  21. cursor: pointer;
  22. width: var(--v-slider-thumb-size);
  23. height: var(--v-slider-thumb-size);
  24. border-radius: 50%;
  25. user-select: none;
  26. background-color: currentColor;
  27. }
  28. @media (forced-colors: active) {
  29. .v-slider-thumb__surface {
  30. background-color: highlight;
  31. }
  32. }
  33. .v-slider-thumb__surface::before {
  34. transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  35. content: "";
  36. color: inherit;
  37. top: 0;
  38. left: 0;
  39. width: 100%;
  40. height: 100%;
  41. border-radius: 50%;
  42. background: currentColor;
  43. position: absolute;
  44. pointer-events: none;
  45. opacity: 0;
  46. }
  47. .v-slider-thumb__surface::after {
  48. content: "";
  49. width: 42px;
  50. height: 42px;
  51. position: absolute;
  52. top: 50%;
  53. left: 50%;
  54. transform: translate(-50%, -50%);
  55. }
  56. .v-slider-thumb__label-container {
  57. position: absolute;
  58. transition: 0.2s cubic-bezier(0.4, 0, 1, 1);
  59. }
  60. .v-slider-thumb__label {
  61. display: flex;
  62. align-items: center;
  63. justify-content: center;
  64. font-size: 0.75rem;
  65. min-width: 35px;
  66. height: 25px;
  67. border-radius: 4px;
  68. padding: 6px;
  69. position: absolute;
  70. user-select: none;
  71. transition: 0.2s cubic-bezier(0.4, 0, 1, 1);
  72. }
  73. .v-slider-thumb__label::before {
  74. content: "";
  75. width: 0;
  76. height: 0;
  77. position: absolute;
  78. }
  79. .v-slider-thumb__ripple {
  80. position: absolute;
  81. left: calc(var(--v-slider-thumb-size) / -2);
  82. top: calc(var(--v-slider-thumb-size) / -2);
  83. width: calc(var(--v-slider-thumb-size) * 2);
  84. height: calc(var(--v-slider-thumb-size) * 2);
  85. background: inherit;
  86. }
  87. .v-slider.v-input--horizontal .v-slider-thumb {
  88. top: 50%;
  89. transform: translateY(-50%);
  90. inset-inline-start: calc(var(--v-slider-thumb-position) - var(--v-slider-thumb-size) / 2);
  91. }
  92. .v-slider.v-input--horizontal .v-slider-thumb__label-container {
  93. left: calc(var(--v-slider-thumb-size) / 2);
  94. top: 0;
  95. }
  96. .v-slider.v-input--horizontal .v-slider-thumb__label {
  97. bottom: calc(var(--v-slider-thumb-size) / 2);
  98. }
  99. .v-locale--is-ltr.v-slider.v-input--horizontal .v-slider-thumb__label, .v-locale--is-ltr .v-slider.v-input--horizontal .v-slider-thumb__label {
  100. transform: translateX(-50%);
  101. }
  102. .v-locale--is-rtl.v-slider.v-input--horizontal .v-slider-thumb__label, .v-locale--is-rtl .v-slider.v-input--horizontal .v-slider-thumb__label {
  103. transform: translateX(50%);
  104. }
  105. .v-slider.v-input--horizontal .v-slider-thumb__label::before {
  106. border-left: 6px solid transparent;
  107. border-right: 6px solid transparent;
  108. border-top: 6px solid currentColor;
  109. bottom: -6px;
  110. }
  111. .v-slider.v-input--vertical .v-slider-thumb {
  112. top: calc(var(--v-slider-thumb-position) - var(--v-slider-thumb-size) / 2);
  113. }
  114. .v-slider.v-input--vertical .v-slider-thumb__label-container {
  115. top: calc(var(--v-slider-thumb-size) / 2);
  116. right: 0;
  117. }
  118. .v-slider.v-input--vertical .v-slider-thumb__label {
  119. top: -12.5px;
  120. left: calc(var(--v-slider-thumb-size) / 2);
  121. }
  122. .v-slider.v-input--vertical .v-slider-thumb__label::before {
  123. border-right: 6px solid currentColor;
  124. border-top: 6px solid transparent;
  125. border-bottom: 6px solid transparent;
  126. left: -6px;
  127. }
  128. .v-slider-thumb--focused .v-slider-thumb__surface::before {
  129. transform: scale(2);
  130. opacity: var(--v-focus-opacity);
  131. }
  132. .v-slider-thumb--pressed {
  133. transition: none;
  134. }
  135. .v-slider-thumb--pressed .v-slider-thumb__surface::before {
  136. opacity: var(--v-pressed-opacity);
  137. }
  138. @media (hover: hover) {
  139. .v-slider-thumb:hover .v-slider-thumb__surface::before {
  140. transform: scale(2);
  141. }
  142. .v-slider-thumb:hover:not(.v-slider-thumb--focused) .v-slider-thumb__surface::before {
  143. opacity: var(--v-hover-opacity);
  144. }
  145. }