-
Notifications
You must be signed in to change notification settings - Fork 11
/
_icheck-material-base.scss
160 lines (144 loc) · 4.18 KB
/
_icheck-material-base.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
/*!
* icheck-material v1.0.0 (https://github.com/bantikyan/icheck-material)
* Copyright 2018 Hovhannes Bantikyan.
* Licensed under MIT (https://github.com/bantikyan/icheck-material/blob/master/LICENSE)
*/
[class*="icheck-material"] {
min-height: 22px;
margin-top: 6px !important;
margin-bottom: 6px !important;
padding-left: 0px;
> label {
padding-left: 29px !important;
min-height: 22px;
line-height: 22px;
display: inline-block;
position: relative;
vertical-align: top;
margin-bottom: 0;
font-weight: normal;
cursor: pointer;
}
> input:first-child {
position: absolute !important;
opacity: 0;
margin: 0;
background-color: #787878;
border-radius: 50%;
appearance: none;
-moz-appearance: none;
-webkit-appearance: none;
-ms-appearance: none;
display: block;
pointer-events: none;
width: 22px;
height: 22px;
outline: none;
transform: scale(2);
-ms-transform: scale(2);
transition: opacity 0.3s, transform 0.3s;
&:disabled {
cursor: default;
+ label,
+ input[type="hidden"] + label,
+ label::before,
+ input[type="hidden"] + label::before {
pointer-events: none;
cursor: default;
filter: alpha(opacity=65);
-webkit-box-shadow: none;
box-shadow: none;
opacity: .65;
}
}
+ label::before,
+ input[type="hidden"] + label::before {
content: "";
display: inline-block;
position: absolute;
width: 22px;
height: 22px;
border: 2px solid #787878;
border-radius: 3px;
margin-left: -29px;
box-sizing: border-box;
}
&:checked {
+ label::after,
+ input[type="hidden"] + label::after {
content: "";
display: inline-block;
position: absolute;
top: 0;
left: 0;
width: 7px;
height: 10px;
border: solid 2px #fff;
border-left: none;
border-top: none;
transform: translate(7.75px, 4.5px) rotate(45deg);
-ms-transform: translate(7.75px, 4.5px) rotate(45deg);
box-sizing: border-box;
}
}
&:not(:checked):not(:disabled):hover {
+ label::before,
+ input[type="hidden"] + label::before {
border-width: 2px;
}
}
&::-ms-check {
opacity: 0;
border-radius: 50%;
}
&:active {
transform: scale(0);
-ms-transform: scale(0);
opacity: 1;
transition: opacity 0s, transform 0s;
}
}
> input[type="radio"]:first-child {
+ label::before,
+ input[type="hidden"] + label::before {
border-radius: 50%;
}
&:checked {
+ label::before,
+ input[type="hidden"] + label::before {
background-color: transparent;
}
+ label::after,
+ input[type="hidden"] + label::after {
content: "";
position: absolute;
width: 10px;
height: 10px;
border-radius: 50%;
border: none;
top: 6px;
left: 6px;
transform: none;
-ms-transform: none;
}
}
}
> input[type="checkbox"]:first-child {
&:checked {
+ label::after,
+ input[type="hidden"] + label::after {
width: 8px;
height: 14px;
transform: translate(7px, 2px) rotate(45deg);
-ms-transform: translate(7px, 2px) rotate(45deg);
}
}
}
}
.icheck-inline {
display: inline-block;
+ .icheck-inline {
margin-left: .75rem;
margin-top: 6px;
}
}