-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
forms.css
68 lines (57 loc) · 1.53 KB
/
forms.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
.form-group {
border: 1px solid transparent;
padding: var(--form-group-padding, 0.4em 0.8em);
margin-bottom: 0.4em;
border-radius: 6px;
transition: border-color 200ms ease-in-out;
&:focus-within {
border-color: var(--form-group-border, #cacaca);
}
& .input-label {
display: block;
margin: 0.4em 0;
}
& .input-label.required::after {
content: ' *';
display: inline;
font-size: 0.8em;
font-weight: 800;
}
& .input, & .input:required:invalid:placeholder-shown {
display: block;
width: var(--input-width, 100%);
max-width: 100%;
color: currentColor;
border-style: solid;
border-color: var(--input-border, #cacaca);
border-width: 0 0 1px 0;
background: transparent;
padding: var(--form-group-padding, 0.5em 0.3em);
transition: color 300ms ease-in-out, background-color 300ms ease-in-out;
}
& textarea.input {
resize: vertical;
}
& .input:invalid {
box-shadow: none;
}
& .input:invalid:not(:focus) {
color: var(--invalid-color, #-871717);
border-color: currentColor;
background-color: var(--invalid-background, #F7C1C1);
}
& input[hidden] + label[for].btn-toggle {
background-color: var(--button-disabled-background);
margin: var(--form-group-margin, 0.3rem);
transition: background-color 300ms ease-in-out;
}
& input[hidden]:checked + label[for].btn-toggle {
background-color: var(--button-background);
}
& input[hidden]:not(:checked) + label[for].btn-toggle .when-checked {
display: none;
}
& input[hidden]:checked + label[for].btn-toggle .when-unchecked {
display: none;
}
}