-
Notifications
You must be signed in to change notification settings - Fork 353
Expand file tree
/
Copy pathcheckbox.module.scss
More file actions
66 lines (58 loc) · 1.4 KB
/
checkbox.module.scss
File metadata and controls
66 lines (58 loc) · 1.4 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
.checkbox__component {
--selected-color: var(--color_bg_state_success);
--selected-color-pressed: var(--color_fg_on_state_success_subtle);
--checkmark-color: var(--color_border_state_success);
display: flex;
/* This is needed so the HiddenInput is positioned correctly */
position: relative;
align-items: center;
gap: 0.571rem;
font-size: 1.143rem;
color: white;
forced-color-adjust: none;
.checkbox {
width: 1.143rem;
height: 1.143rem;
border: 2px solid var(--color_fg_default);
border-radius: 4px;
transition: all 200ms;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
svg {
width: 1rem;
height: 1rem;
fill: none;
stroke: var(--functional-gray-0);
stroke-width: 3px;
stroke-dasharray: 22px;
stroke-dashoffset: 66;
transition: all 200ms;
}
&[data-focus-visible] .checkbox {
outline: 2px solid var(--color_fg_selected);
outline-offset: 2px;
}
&[data-selected],
&[data-indeterminate] {
.checkbox {
border-color: var(--selected-color);
background: var(--selected-color);
}
&[data-pressed] .checkbox {
border-color: var(--selected-color-pressed);
background: var(--selected-color-pressed);
}
svg {
stroke-dashoffset: 44;
}
}
&[data-indeterminate] {
& svg {
stroke: none;
fill: var(--checkmark-color);
}
}
}