_scrollbar.scss 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  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. // ._scrollbar {
  12. // overflow-x: hidden !important;
  13. // overflow-y: auto;
  14. // }
  15. /*
  16. * Scrollbar rail styles
  17. */
  18. .ps__rail-x {
  19. display: none;
  20. opacity: 0;
  21. transition: background-color 0.2s linear, opacity 0.2s linear;
  22. -webkit-transition: background-color 0.2s linear, opacity 0.2s linear;
  23. height: 15px;
  24. /* there must be 'bottom' or 'top' for ps__rail-x */
  25. bottom: 0px;
  26. /* please don't change 'position' */
  27. position: absolute;
  28. }
  29. .ps__rail-y {
  30. display: none;
  31. opacity: 0;
  32. transition: background-color 0.2s linear, opacity 0.2s linear;
  33. -webkit-transition: background-color 0.2s linear, opacity 0.2s linear;
  34. width: 15px;
  35. /* there must be 'right' or 'left' for ps__rail-y */
  36. right: 0;
  37. /* please don't change 'position' */
  38. position: absolute;
  39. }
  40. .ps--active-x > .ps__rail-x,
  41. .ps--active-y > .ps__rail-y {
  42. display: block;
  43. background-color: transparent;
  44. }
  45. .ps--focus > .ps__rail-x,
  46. .ps--focus > .ps__rail-y,
  47. .ps--scrolling-x > .ps__rail-x,
  48. .ps--scrolling-y > .ps__rail-y {
  49. opacity: 0.6;
  50. }
  51. .ps__rail-x:hover,
  52. .ps__rail-y:hover,
  53. .ps__rail-x:focus,
  54. .ps__rail-y:focus {
  55. background-color: transparent;
  56. opacity: 0.9;
  57. }
  58. /*
  59. * Scrollbar thumb styles
  60. */
  61. .ps__thumb-x {
  62. background-color: #aaa;
  63. border-radius: 6px;
  64. height: 6px;
  65. /* there must be 'bottom' for ps__thumb-x */
  66. bottom: 2px;
  67. /* please don't change 'position' */
  68. position: absolute;
  69. }
  70. .ps__thumb-y {
  71. @include gradient-vertical($scrollbarBackground, $scrollbarBackground2);
  72. border-radius: 6px;
  73. width: 6px;
  74. /* there must be 'right' for ps__thumb-y */
  75. right: 0px;
  76. /* please don't change 'position' */
  77. position: absolute;
  78. }
  79. /* MS supports */
  80. @supports (-ms-overflow-style: none) {
  81. .ps {
  82. overflow: auto !important;
  83. }
  84. }
  85. @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  86. .ps {
  87. overflow: auto !important;
  88. }
  89. }
  90. .ps__rail-x:hover,
  91. .ps__rail-y:hover,
  92. .ps__rail-x:focus,
  93. .ps__rail-y:focus {
  94. background-color: transparent;
  95. opacity: 0.9;
  96. }
  97. // Scrollbars
  98. //
  99. ::-webkit-scrollbar {
  100. width: 8px;
  101. height: 8px;
  102. }
  103. ::-webkit-scrollbar:hover {
  104. height: 8px;
  105. }
  106. ::-webkit-scrollbar-button:start:decrement,
  107. ::-webkit-scrollbar-button:end:increment {
  108. display: none;
  109. }
  110. ::-webkit-scrollbar-button:horizontal:decrement {
  111. display: none;
  112. }
  113. ::-webkit-scrollbar-button:horizontal:increment {
  114. display: none;
  115. }
  116. ::-webkit-scrollbar-button:vertical:decrement {
  117. display: none;
  118. }
  119. ::-webkit-scrollbar-button:vertical:increment {
  120. display: none;
  121. }
  122. ::-webkit-scrollbar-button:horizontal:decrement:active {
  123. background-image: none;
  124. }
  125. ::-webkit-scrollbar-button:horizontal:increment:active {
  126. background-image: none;
  127. }
  128. ::-webkit-scrollbar-button:vertical:decrement:active {
  129. background-image: none;
  130. }
  131. ::-webkit-scrollbar-button:vertical:increment:active {
  132. background-image: none;
  133. }
  134. ::-webkit-scrollbar-track-piece {
  135. background-color: transparent;
  136. }
  137. ::-webkit-scrollbar-thumb:vertical {
  138. height: 50px;
  139. background: -webkit-gradient(
  140. linear,
  141. left top,
  142. right top,
  143. color-stop(0%, $scrollbarBackground),
  144. color-stop(100%, $scrollbarBackground2)
  145. );
  146. border: 1px solid $scrollbarBorder;
  147. border-top: 1px solid $scrollbarBorder;
  148. border-left: 1px solid $scrollbarBorder;
  149. }
  150. ::-webkit-scrollbar-thumb:horizontal {
  151. width: 50px;
  152. background: -webkit-gradient(
  153. linear,
  154. left top,
  155. left bottom,
  156. color-stop(0%, $scrollbarBackground),
  157. color-stop(100%, $scrollbarBackground2)
  158. );
  159. border: 1px solid $scrollbarBorder;
  160. border-top: 1px solid $scrollbarBorder;
  161. border-left: 1px solid $scrollbarBorder;
  162. }
  163. // Baron styles
  164. .baron {
  165. // display: inline-block; // this brakes phantomjs rendering (width becomes 0)
  166. overflow: hidden;
  167. }
  168. // Fix for side menu on mobile devices
  169. .main-view.baron {
  170. width: unset;
  171. }
  172. .baron__clipper {
  173. position: relative;
  174. overflow: hidden;
  175. }
  176. .baron__scroller {
  177. overflow-y: scroll;
  178. -ms-overflow-style: none;
  179. -moz-box-sizing: border-box;
  180. box-sizing: border-box;
  181. margin: 0;
  182. border: 0;
  183. padding: 0;
  184. width: 100%;
  185. height: 100%;
  186. -webkit-overflow-scrolling: touch;
  187. /* remove line to customize scrollbar in iOs */
  188. }
  189. .baron__scroller::-webkit-scrollbar {
  190. width: 0;
  191. height: 0;
  192. }
  193. .baron__track {
  194. display: none;
  195. position: absolute;
  196. top: 0;
  197. right: 0;
  198. bottom: 0;
  199. }
  200. .baron._scrollbar .baron__track {
  201. display: block;
  202. }
  203. .baron__free {
  204. position: absolute;
  205. top: 0;
  206. bottom: 0;
  207. right: 0;
  208. }
  209. .baron__bar {
  210. display: none;
  211. position: absolute;
  212. right: 0;
  213. z-index: 1;
  214. // width: 10px;
  215. background: #999;
  216. // height: 15px;
  217. width: 15px;
  218. transition: background-color 0.2s linear, opacity 0.2s linear;
  219. opacity: 0;
  220. }
  221. .baron._scrollbar .baron__bar {
  222. display: block;
  223. @include gradient-vertical($scrollbarBackground, $scrollbarBackground2);
  224. border-radius: 6px;
  225. width: 6px;
  226. /* there must be 'right' for ps__thumb-y */
  227. right: 0px;
  228. /* please don't change 'position' */
  229. position: absolute;
  230. // background-color: transparent;
  231. // opacity: 0.6;
  232. &:hover,
  233. &:focus {
  234. // background-color: transparent;
  235. opacity: 0.9;
  236. }
  237. }
  238. .panel-hover-highlight .baron__track .baron__bar {
  239. opacity: 0.6;
  240. }
  241. .baron._scrolling > .baron__track .baron__bar {
  242. opacity: 0.9;
  243. }
  244. // fix for phantomjs
  245. .body--phantomjs .baron__track .baron__bar {
  246. opacity: 0 !important;
  247. }
  248. .baron__control {
  249. display: none;
  250. }
  251. .baron.panel-content--scrollable {
  252. // Width needs to be set to prevent content width issues
  253. // Set to less than 100% for fixing Firefox issue (white stripe on the right of scrollbar)
  254. width: calc(100% - 2px);
  255. .baron__scroller {
  256. padding-top: 1px;
  257. }
  258. }
  259. // Custom styles for 'react-custom-scrollbars'
  260. .custom-scrollbars {
  261. // Fix for Firefox. For some reason sometimes .view container gets a height of its content, but in order to
  262. // make scroll working it should fit outer container size (scroll appears only when inner container size is
  263. // greater than outer one).
  264. display: flex;
  265. flex-grow: 1;
  266. .view {
  267. display: flex;
  268. flex-grow: 1;
  269. }
  270. .track-vertical {
  271. border-radius: 3px;
  272. width: 6px !important;
  273. right: 2px;
  274. bottom: 2px;
  275. top: 2px;
  276. }
  277. .track-horizontal {
  278. border-radius: 3px;
  279. height: 6px !important;
  280. right: 2px;
  281. bottom: 2px;
  282. left: 2px;
  283. }
  284. .thumb-vertical {
  285. @include gradient-vertical($scrollbarBackground, $scrollbarBackground2);
  286. border-radius: 6px;
  287. }
  288. .thumb-horizontal {
  289. @include gradient-horizontal($scrollbarBackground, $scrollbarBackground2);
  290. border-radius: 6px;
  291. }
  292. }