Socialify

Folder ..

Viewing _pm-meterbar.scss
88 lines (72 loc) • 1.6 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
@mixin meterbar-size($size: 1.5rem) {
	height: $size;
	border-radius: #{$size/2};

	&::-moz-meter-bar {
		border-radius: #{$size/2};
	}

	&::-webkit-meter-bar {
		height: $size; // Chrome 83 does not make meter and its bar the same height -_-v
	}

	&::-webkit-meter-optimum-value {
		border-radius: #{$size/2};
	}

	&::-webkit-meter-suboptimum-value {
		border-radius: #{$size/2};
	}

	&::-webkit-meter-even-less-good-value {
		border-radius: #{$size/2};
	}
}

.meterbar {
	@include meterbar-size;

	width: 100%;
	background: var(--bgcolor-meterbar, $pm-global-muted);

	//-webkit-appearance: none; // Can't. Well, because Chrome.
	// -moz-appearance: none;
	/* autoprefixer: ignore next */
	// appearance: none;


	&::-webkit-meter-bar {
		border: none;
		background: none;
	}

	&::-moz-meter-bar {
		display: inherit;
	}

	&:not(#{&}--primary) {
		&::-webkit-meter-optimum-value {
			background: $pm-global-success;
		}
		&::-webkit-meter-suboptimum-value {
			background: $pm-global-attention;
		}
		&::-webkit-meter-even-less-good-value {
			background: $pm-global-warning;
		}

		&:-moz-meter-optimum::-moz-meter-bar {
			background: $pm-global-success;
		}
		&:-moz-meter-sub-optimum::-moz-meter-bar {
			background: $pm-global-attention;
		}
		&:-moz-meter-sub-sub-optimum::-moz-meter-bar {
			background: $pm-global-warning;
		}
	}

	&--primary {
		&::-webkit-meter-optimum-value {
			background: $pm-primary;
		}
		&::-webkit-meter-suboptimum-value {
			background: $pm-primary;
		}
		&::-webkit-meter-even-less-good-value {
			background: $pm-primary;
		}

		&::-moz-meter-bar {
			background: $pm-primary;
		}
	}

	&.is-thin {
		@include meterbar-size(.375em);
	}
}