_scrollbar.scss 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. /*
  2. * Container style
  3. */
  4. .ps {
  5. overflow: hidden !important;
  6. overflow-anchor: none;
  7. -ms-overflow-style: none;
  8. touch-action: auto;
  9. -ms-touch-action: auto;
  10. }
  11. /*
  12. * Scrollbar rail styles
  13. */
  14. .ps__rail-x {
  15. display: none;
  16. opacity: 0;
  17. transition: background-color 0.2s linear, opacity 0.2s linear;
  18. -webkit-transition: background-color 0.2s linear, opacity 0.2s linear;
  19. height: 15px;
  20. /* there must be 'bottom' or 'top' for ps__rail-x */
  21. bottom: 0px;
  22. /* please don't change 'position' */
  23. position: absolute;
  24. }
  25. .ps__rail-y {
  26. display: none;
  27. opacity: 0;
  28. transition: background-color 0.2s linear, opacity 0.2s linear;
  29. -webkit-transition: background-color 0.2s linear, opacity 0.2s linear;
  30. width: 15px;
  31. /* there must be 'right' or 'left' for ps__rail-y */
  32. right: 0;
  33. /* please don't change 'position' */
  34. position: absolute;
  35. }
  36. .ps--active-x > .ps__rail-x,
  37. .ps--active-y > .ps__rail-y {
  38. display: block;
  39. background-color: transparent;
  40. }
  41. .ps--focus > .ps__rail-x,
  42. .ps--focus > .ps__rail-y,
  43. .ps--scrolling-x > .ps__rail-x,
  44. .ps--scrolling-y > .ps__rail-y {
  45. opacity: 0.6;
  46. }
  47. .ps__rail-x:hover,
  48. .ps__rail-y:hover,
  49. .ps__rail-x:focus,
  50. .ps__rail-y:focus {
  51. background-color: transparent;
  52. opacity: 0.9;
  53. }
  54. /*
  55. * Scrollbar thumb styles
  56. */
  57. .ps__thumb-x {
  58. background-color: #aaa;
  59. border-radius: 6px;
  60. height: 6px;
  61. /* there must be 'bottom' for ps__thumb-x */
  62. bottom: 2px;
  63. /* please don't change 'position' */
  64. position: absolute;
  65. }
  66. .ps__thumb-y {
  67. @include gradient-vertical($scrollbarBackground, $scrollbarBackground2);
  68. border-radius: 6px;
  69. width: 6px;
  70. /* there must be 'right' for ps__thumb-y */
  71. right: 0px;
  72. /* please don't change 'position' */
  73. position: absolute;
  74. }
  75. /* MS supports */
  76. @supports (-ms-overflow-style: none) {
  77. .ps {
  78. overflow: auto !important;
  79. }
  80. }
  81. @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  82. .ps {
  83. overflow: auto !important;
  84. }
  85. }
  86. .ps__rail-x:hover,
  87. .ps__rail-y:hover,
  88. .ps__rail-x:focus,
  89. .ps__rail-y:focus {
  90. background-color: transparent;
  91. opacity: 0.9;
  92. }
  93. // Srollbars
  94. //
  95. ::-webkit-scrollbar {
  96. width: 8px;
  97. height: 8px;
  98. }
  99. ::-webkit-scrollbar:hover {
  100. height: 8px;
  101. }
  102. ::-webkit-scrollbar-button:start:decrement,
  103. ::-webkit-scrollbar-button:end:increment {
  104. display: none;
  105. }
  106. ::-webkit-scrollbar-button:horizontal:decrement {
  107. display: none;
  108. }
  109. ::-webkit-scrollbar-button:horizontal:increment {
  110. display: none;
  111. }
  112. ::-webkit-scrollbar-button:vertical:decrement {
  113. display: none;
  114. }
  115. ::-webkit-scrollbar-button:vertical:increment {
  116. display: none;
  117. }
  118. ::-webkit-scrollbar-button:horizontal:decrement:active {
  119. background-image: none;
  120. }
  121. ::-webkit-scrollbar-button:horizontal:increment:active {
  122. background-image: none;
  123. }
  124. ::-webkit-scrollbar-button:vertical:decrement:active {
  125. background-image: none;
  126. }
  127. ::-webkit-scrollbar-button:vertical:increment:active {
  128. background-image: none;
  129. }
  130. ::-webkit-scrollbar-track-piece {
  131. background-color: transparent;
  132. }
  133. ::-webkit-scrollbar-thumb:vertical {
  134. height: 50px;
  135. background: -webkit-gradient(
  136. linear,
  137. left top,
  138. right top,
  139. color-stop(0%, $scrollbarBackground),
  140. color-stop(100%, $scrollbarBackground2)
  141. );
  142. border: 1px solid $scrollbarBorder;
  143. border-top: 1px solid $scrollbarBorder;
  144. border-left: 1px solid $scrollbarBorder;
  145. }
  146. ::-webkit-scrollbar-thumb:horizontal {
  147. width: 50px;
  148. background: -webkit-gradient(
  149. linear,
  150. left top,
  151. left bottom,
  152. color-stop(0%, $scrollbarBackground),
  153. color-stop(100%, $scrollbarBackground2)
  154. );
  155. border: 1px solid $scrollbarBorder;
  156. border-top: 1px solid $scrollbarBorder;
  157. border-left: 1px solid $scrollbarBorder;
  158. }