-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy path_m-scrollbar.scss
More file actions
65 lines (58 loc) · 1.32 KB
/
_m-scrollbar.scss
File metadata and controls
65 lines (58 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
@use "m-hover";
/**
* Scrollbar - Make an invisible scrollbar and custom the scrollbar color
*
* ALERT : Don't use this mixin neither on the html element, nor on the body element to avoid deteriorating the accessibility
*
* @author Milan Ricoul
*
* 1/ Invisible scrollbar
*
* Examples :
*
* .my-scrollbar {
* @include scrollbar-invisible;
* }
*
* ------------------------------------------------------------------------
*
* 1/ Scrollbar color
*
* @param $size
* @param $scrollbar-color
* @param $track-color
*
* Examples :
*
* .my-scrollbar-custom {
* @include scrollbar-color(10px, $color-primary, $color-dark);
* }
*
*/
@mixin scrollbar-invisible {
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
&::-webkit-scrollbar {
display: none;
}
}
@mixin scrollbar-color($size, $scrollbar-color, $track-color) {
&::-webkit-scrollbar {
display: none;
width: $size;
height: $size;
}
&::-webkit-scrollbar-thumb {
background: $scrollbar-color;
border-radius: 20px;
}
&::-webkit-scrollbar-track {
background: $track-color;
border-radius: 20px;
}
@include m-hover.hover {
&::-webkit-scrollbar {
display: block;
}
}
}