-
Notifications
You must be signed in to change notification settings - Fork 3
/
jquery-pie-loader.scss
75 lines (61 loc) · 1.23 KB
/
jquery-pie-loader.scss
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
/*
* jQuery Pie-Loader Plugin 0.1
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
// Base styles for every pie chart
%pie-base {
position: relative;
display: inline-block;
margin: 0 auto;
overflow: hidden;
border-radius: 50%;
svg {
width: 100%;
height: 100%;
overflow: visible;
transform: rotate(-90deg);
}
.percentage {
position: absolute;
top: 50%;
left: 50%;
font-family: Helvetica;
font-size: 2rem;
opacity: 0;
transform: translate(-50%, -50%);
}
&.rendered {
background: none;
.percentage {
opacity: 1;
}
}
}
// Custom styles for pie charts, 4 optional parameters
@mixin pie($text-color: hsla(0, 100%, 100%, 1), $base-color: hsla(210, 29%, 29%, 1), $fill-color: hsla(6, 78%, 57%, 1), $shadow: false) {
@extend %pie-base;
@if $shadow == "true" {
$shadow: 2px 2px 10px 0 rgba(0, 0, 0, 0.36);
}
@else {
$shadow: none;
}
background: $base-color;
box-shadow: $shadow;
circle:nth-child(1) {
fill: $base-color;
}
circle:nth-child(2) {
fill: $base-color;
stroke: $fill-color;
}
.percentage {
color: $text-color;
}
}
// Default pie
.pie-loader {
@include pie();
}