-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCheckbox.css
More file actions
80 lines (66 loc) · 2.14 KB
/
Copy pathCheckbox.css
File metadata and controls
80 lines (66 loc) · 2.14 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
/* Checkbox component styling */
.checkbox-label {
cursor: pointer;
display: flex;
flex-direction: row;
align-items: center;
}
.checkbox-label.checkbox-disabled {
color: var(--text-color, #424242); /* theme.color.text.default */
cursor: not-allowed;
opacity: 0.4;
}
.checkbox-label input {
position: absolute;
opacity: 0;
cursor: pointer;
height: 0;
width: 0;
}
.checkbox-custom {
height: 1.6rem;
width: 1.6rem;
display: flex;
justify-content: center;
align-items: center;
flex-shrink: 0;
}
.checkbox-label input:not(:checked) + .checkbox-custom {
border: 1px solid var(--checkbox-border-color, #424242); /* theme.color.primary.gray.darker */
}
.checkbox-label input:checked + .checkbox-custom {
background-color: var(--checkbox-checked-bg, #b03808); /* theme.color.primary.orange.darkest */
}
.checkbox-icon {
color: white;
height: 1rem;
width: 1rem;
display: none;
}
.checkbox-label input:checked + .checkbox-custom .checkbox-icon {
display: block;
}
/* Focus styles */
.checkbox-label:focus-within {
border-radius: 0.4rem;
background-color: var(--checkbox-focus-bg, #f1f1f1); /* theme.color.neutral.pageBackground */
/* Browser default focus outline */
outline: 0.2rem auto highlight;
/* stylelint-disable-next-line declaration-block-no-duplicate-properties */
outline: 0.2rem auto -webkit-focus-ring-color; /* Fallback for webkit browsers */
}
/* stylelint-disable no-descending-specificity */
/* Focus-within must come after input state selectors to properly override border styling */
.checkbox-label:focus-within .checkbox-custom {
border: 1px solid var(--checkbox-checked-bg, #b03808); /* theme.color.primary.orange.darkest */
}
/* Fallback for browsers that don't support :focus-within */
.checkbox-label.focus-within {
border-radius: 0.4rem;
background-color: var(--checkbox-focus-bg, #f1f1f1); /* theme.color.neutral.pageBackground */
}
/* Focus fallback must also come after input state selectors */
.checkbox-label.focus-within .checkbox-custom {
border: 1px solid var(--checkbox-checked-bg, #b03808); /* theme.color.primary.orange.darkest */
}
/* stylelint-enable no-descending-specificity */