1 @mixin scrollbar-rail-default($theme) {
3 position: absolute; /* please don't change 'position' */
4 opacity: map_get($theme, rail-default-opacity);
5 transition: background-color .2s linear, opacity .2s linear;
8 @mixin scrollbar-rail-hover($theme) {
9 background-color: map_get($theme, rail-hover-bg);
10 opacity: map_get($theme, rail-hover-opacity);
13 @mixin scrollbar-default($theme) {
14 position: absolute; /* please don't change 'position' */
15 background-color: map_get($theme, bar-container-hover-bg);
16 border-radius: map_get($theme, border-radius);
17 transition: background-color .2s linear, height .2s linear, width .2s ease-in-out,
18 border-radius .2s ease-in-out;
21 @mixin scrollbar-hover($theme) {
22 background-color: map_get($theme, bar-hover-bg);
25 @mixin in-scrolling($theme) {
27 &.ps-x > .ps-scrollbar-x-rail {
28 @include scrollbar-rail-hover($theme);
30 @include scrollbar-hover($theme);
31 height: map_get($theme, scrollbar-x-hover-height);
34 &.ps-y > .ps-scrollbar-y-rail {
35 @include scrollbar-rail-hover($theme);
37 @include scrollbar-hover($theme);
38 width: map_get($theme, scrollbar-y-hover-width);
44 // Layout and theme mixin
45 @mixin ps-container($theme) {
46 -ms-touch-action: auto;
48 overflow: hidden !important;
49 -ms-overflow-style: none;
52 @supports (-ms-overflow-style: none) {
53 overflow: auto !important;
56 @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
57 overflow: auto !important;
60 &.ps-active-x > .ps-scrollbar-x-rail,
61 &.ps-active-y > .ps-scrollbar-y-rail {
63 background-color: map_get($theme, bar-bg);
66 @include in-scrolling($theme);
68 > .ps-scrollbar-x-rail {
69 @include scrollbar-rail-default($theme);
70 bottom: map_get($theme, scrollbar-x-rail-bottom); /* there must be 'bottom' for ps-scrollbar-x-rail */
71 height: map_get($theme, scrollbar-x-rail-height);
74 @include scrollbar-default($theme);
75 bottom: map_get($theme, scrollbar-x-bottom); /* there must be 'bottom' for ps-scrollbar-x */
76 height: map_get($theme, scrollbar-x-height);
81 height: map_get($theme, scrollbar-x-hover-height);
86 > .ps-scrollbar-y-rail {
87 @include scrollbar-rail-default($theme);
88 right: map_get($theme, scrollbar-y-rail-right); /* there must be 'right' for ps-scrollbar-y-rail */
89 width: map_get($theme, scrollbar-y-rail-width);
92 @include scrollbar-default($theme);
93 right: map_get($theme, scrollbar-y-right); /* there must be 'right' for ps-scrollbar-y */
94 width: map_get($theme, scrollbar-y-width);
99 width: map_get($theme, scrollbar-y-hover-width);
105 @include in-scrolling($theme);
107 > .ps-scrollbar-x-rail,
108 > .ps-scrollbar-y-rail {
109 opacity: map_get($theme, rail-container-hover-opacity);
112 > .ps-scrollbar-x-rail:hover {
113 @include scrollbar-rail-hover($theme);
116 @include scrollbar-hover($theme);
120 > .ps-scrollbar-y-rail:hover {
121 @include scrollbar-rail-hover($theme);
124 @include scrollbar-hover($theme);