radio.scss
1.93 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
89
90
91
92
93
94
95
// rc -> radio & checkbox
// https://www.inserthtml.com/2012/06/custom-form-radio-checkbox/
$radio-size: 6px;
$radio-label-size: $radio-size ;
$radio-offset: $radio-size / 2;
$checkbox-size: 6px;
$checkbox-check-width: $checkbox-size / 4 * 3;
$checkbox-check-height: $checkbox-size / 4 * 5;
.lbp-rc-wrapper {
position: relative;
height: 20px;
clear: both;
.lbp-rc-input {
display: none;
}
.tag {
float: left;
margin-left: 20px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
// position: absolute;
// left: 24px;
}
.lbp-rc-input + label {
position: absolute;
left: 0;
top: 2px;
appearance: none;
background-color: #fafafa;
border: 1px solid #cacece;
}
}
.lbp-checkbox {
& + label {
top: 2px;
padding: $checkbox-size; // 控制 checkbox 的大小
border-radius: 2px;
}
&:checked + label:after {
content: " ";
position: absolute;
top: $checkbox-size / 4 - 1px ;
left: $checkbox-size / 4 * 3 - 1px;
z-index: 999;
width: $checkbox-check-width;
height: $checkbox-check-height;
// width: 5px;
// height: 11px;
border-style: solid;
border-width: 0 1px 1px 0;
transform: rotate(45deg);
// color: #3396fb;
}
}
.lbp-radio {
& + label {
padding: $radio-size;
border-radius: 50px;
display: inline-block;
}
// &:checked + label {
// background-color: #e9ecee;
// color: #99a1a7;
// border: 1px solid #adb8c0;
// box-shadow: 0 1px 2px rgba(0,0,0,0.05), inset 0px -15px 10px -12px rgba(0,0,0,0.05), inset 15px 10px -12px rgba(255,255,255,0.1), inset 0px 0px 10px rgba(0,0,0,0.1);
// }
// // thanks for https://mobile.ant.design/components/checkbox-cn/
&:checked + label:after {
content: ' ';
position: absolute;
top: $radio-offset;
left: $radio-offset;
width: $radio-label-size;
height: $radio-label-size;
border-radius: 50px;
background: #99a1a7;
box-shadow: inset 0px 0px 10px rgba(0,0,0,0.3);
text-shadow: 0px;
font-size: 32px;
}
}