-
Notifications
You must be signed in to change notification settings - Fork 975
/
theme.module.css
130 lines (114 loc) · 2.85 KB
/
theme.module.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
@import '../colors.module.css';
@import '../variables.module.css';
@import './config.module.css';
.field {
display: block;
height: var(--checkbox-size);
margin-bottom: var(--checkbox-field-margin-bottom);
position: relative;
white-space: nowrap;
@apply --reset;
& .ripple {
background-color: var(--checkbox-color);
opacity: 0.3;
transition-duration: var(--checkbox-ripple-duration);
}
}
.text {
color: var(--checkbox-text-color);
display: inline-block;
font-size: var(--checkbox-text-font-size);
line-height: var(--checkbox-size);
padding-left: var(--unit);
vertical-align: top;
white-space: nowrap;
}
.check {
border-color: var(--checkbox-border-color);
border-radius: 2px;
border-style: solid;
border-width: 2px;
cursor: pointer;
display: inline-block;
height: var(--checkbox-size);
position: relative;
transition-duration: var(--checkbox-transition-duration);
transition-property: background-color;
transition-timing-function: var(--animation-curve-default);
vertical-align: top;
width: var(--checkbox-size);
@apply --reset;
&.checked {
background-color: var(--checkbox-color);
border-color: var(--checkbox-color);
&::after {
animation: checkmark-expand 140ms ease-out forwards;
border-bottom-width: 2px;
border-color: var(--color-background);
border-left: 0;
border-right-width: 2px;
border-style: solid;
border-top: 0;
content: '';
height: calc(1.2 * var(--unit));
left: calc(0.4 * var(--unit));
position: absolute;
top: calc(-0.1 * var(--unit));
transform: rotate(45deg);
width: calc(0.7 * var(--unit));
}
}
}
.disabled {
& > .text {
color: var(--checkbox-disabled-color);
}
& > .check {
border-color: var(--checkbox-disabled-color);
cursor: auto;
&.checked {
background-color: var(--checkbox-disabled-color);
border-color: transparent;
cursor: auto;
}
}
}
.input {
height: 0;
opacity: 0;
overflow: hidden;
position: absolute;
width: 0;
&:focus ~ .check {
&::before {
background-color: var(--checkbox-focus-color);
border-radius: 50%;
content: '';
height: var(--checkbox-focus-size);
left: 50%;
margin-left: calc(-1 * var(--checkbox-focus-size) / 2);
margin-top: calc(-1 * var(--checkbox-focus-size) / 2);
pointer-events: none;
position: absolute;
top: 50%;
width: var(--checkbox-focus-size);
}
&.checked::before {
background-color: var(--checkbox-focus-checked-color);
}
}
}
@keyframes checkmark-expand {
0% {
height: 0;
left: calc(0.6 * var(--unit));
top: calc(0.9 * var(--unit));
width: 0;
}
100% {
height: calc(1.2 * var(--unit));
left: calc(0.4 * var(--unit));
top: calc(-0.1 * var(--unit));
width: calc(0.7 * var(--unit));
}
}