-
Notifications
You must be signed in to change notification settings - Fork 9
/
vaadin-checkbox.css
54 lines (44 loc) · 1.32 KB
/
vaadin-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
/* Dividers */
:host([theme~="dividers"]) {
position: relative;
}
:host([theme~="dividers"]:not(:last-of-type))::after {
border-bottom: 1px solid var(--lumo-contrast-10pct);
content: "";
inset: auto 0 0 0;
pointer-events: none;
position: absolute;
}
/* Align: Right */
:host([theme~="align-right"]) .vaadin-checkbox-container {
grid-template-columns: 1fr auto;
}
:host([theme~="align-right"]) [part='checkbox'],
:host([theme~="align-right"]) ::slotted(input) {
grid-column: 2;
}
:host([theme~="align-right"][has-label]) ::slotted(label) {
padding-inline-start: 0;
}
/* Switch */
:host([theme~="switch"]) [part='checkbox'] {
border-radius: 9999px;
width: var(--lumo-size-m);
}
:host([theme~="switch"]) [part='checkbox']::after {
content: "";
height: calc(var(--lumo-size-m) / 3);
background-color: var(--lumo-secondary-text-color);
border-radius: 9999px;
inset: 0;
/* (size-m/2 - size-m/3) / 2 = size-m/12 */
margin: calc(var(--lumo-size-m) / 12);
opacity: 1;
transition: transform 0.2s;
width: calc(var(--lumo-size-m) / 3);
}
:host([theme~="switch"][checked]) [part='checkbox']::after {
background-color: var(--lumo-primary-contrast-color);
/* size-m - size-m/3 - 2*size-m/12 = size-m/2 */
transform: translateX(calc(var(--lumo-size-m) / 2));
}