Socialify

Folder ..

Viewing _pm-custom-scrollbar.scss
54 lines (44 loc) • 1.2 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
$scrollbar-track-color: transparent !default;
$scrollbar-size       : .6rem !default;
$scrollbar-margin     : .2rem !default;

@if $custom-scroll {

	body {
		&:not(.isDarkMode) {
			--scrollbar-thumb-color      : #{rgba(black, .35)};
			--scrollbar-thumb-hover-color: #{rgba(black, .5)};
		}

		&.isDarkMode {
			--scrollbar-thumb-color      : #{rgba(white, .2)};
			--scrollbar-thumb-hover-color: #{rgba(white, .5)};
		}
	}

	* {
		$real-size: $scrollbar-size + ($scrollbar-margin * 2);

		// W3C, Firefox
		scrollbar-width: thin;
		scrollbar-color: var(--scrollbar-thumb-color) $scrollbar-track-color;

		// webkit specific
		&::-webkit-scrollbar {
			width: $real-size;
			height: $real-size;
		}

		&::-webkit-scrollbar-thumb {
			border: $scrollbar-margin solid transparent; // Margin
			background-clip: padding-box; // Booyah!
			border-radius: $real-size/2;
			background-color: var(--scrollbar-thumb-color);
		}

		&::-webkit-scrollbar-track {
			background-color: $scrollbar-track-color;
		}

		&::-webkit-scrollbar-thumb:horizontal,
		&::-webkit-scrollbar-thumb:vertical {
			&:hover {
				background-color: var(--scrollbar-thumb-hover-color);
			}
		}

		&::-webkit-scrollbar-corner {
			visibility: hidden;
		}
	}
}