/
Checkbox.css
115 lines (94 loc) · 1.67 KB
/
Checkbox.css
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
@import '../variables.css';
.root {
display: flex;
align-items: center;
transition: background-color 0.2s ease;
margin-bottom: var(--controlMarginBottom);
&.rootFullWidth {
width: 100%;
}
&.marginBottom0 {
margin-bottom: 0;
}
&.rootHover {
border-radius: 6px;
&:hover {
background-color: #efefef;
}
}
&.inline {
display: inline;
& .checkboxInput {
margin-bottom: 4px;
}
}
&.checkboxHasFeedback {
margin-bottom: 0;
}
&.hovered {
background-color: #efefef;
}
}
.checkboxLabel {
cursor: pointer;
flex-grow: 2;
padding: 7px 2px;
margin: 0 4px;
font-weight: 600;
color: var(--labelColor);
&.error {
color: #900;
}
}
.formLabel {
composes: checkboxLabel;
font-weight: bold;
text-transform: Uppercase;
color: var(--labelColor);
&.error {
color: #900;
}
}
/* fix for shrinkage issues with checkbox as a flex-child */
:global input[type='checkbox'] {
min-width: 16px;
}
input[type='checkbox'].checkboxInput {
vertical-align: middle;
margin: 0 9px;
& + .checkboxLabel {
margin-left: 0;
}
&.hidden {
clip: rect(0, 0, 0, 0);
height: 1px;
width: 1px;
position: absolute;
margin: -1px;
border: 0;
padding: 0;
}
}
.iconContainer {
width: 2rem;
height: 2rem;
cursor: pointer;
margin-bottom: 0;
display: flex;
align-items: center;
border: 1px dotted transparent;
&::after {
content: '\200B';
position: absolute;
}
}
.checkboxFeedback {
display: block;
padding: 0 0.4rem;
margin-bottom: var(--controlMarginBottom);
}
.checkboxWarning {
composes: checkboxFeedback;
color: #e27c3e;
font-weight: 700;
}