-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmdform.css
More file actions
86 lines (76 loc) · 2.15 KB
/
Copy pathmdform.css
File metadata and controls
86 lines (76 loc) · 2.15 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
81
82
83
84
85
86
/* mdform.css */
/* v0.0.7 */
.mdform-container {
border: 1px solid var(--border);
border-radius: 5px; /* Optional: rounded corners */
padding: 1em 2em; /* Optional: add spacing inside the border */
margin: 1em 0; /* Optional: add spacing outside the border */
}
/* stockhom.css has standard 7 em width we change it to 2em visualization for a better list in one line */
input[type="radio"].form-control,
input[type="checkbox"].form-control {
min-width: 2em;
}
label[type="radio"].form-control,
label[type="checkbox"].form-control {
display: inline-block; /* Allows labels to sit side-by-side */
margin-right: 1em; /* Adds spacing between radio buttons + text */
cursor: pointer; /* Ensures the cursor changes to a pointer on hover */
}
/* --- Standard Checkbox --- */
/* We leave this alone as requested, just adding a pointer cursor */
input.form-control:not(.switch) {
cursor: pointer;
}
/* --- Slider (The Switch) --- */
input.form-control.switch {
/* Instead of display: none, use this: */
position: absolute;
opacity: 0;
width: 0;
height: 0;
overflow: hidden;
pointer-events: none; /* Prevents clicking the invisible box */
}
input.form-control.switch + label.switch {
position: relative;
padding-left: 55px;
cursor: pointer;
display: inline-flex;
align-items: center;
min-height: 24px;
user-select: none;
}
/* The Slider Track */
input.form-control.switch + label.switch::before {
content: "";
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 44px;
height: 22px;
background-color: #ccc;
border-radius: 20px;
transition: background-color 0.2s;
}
/* The Slider Knob */
input.form-control.switch + label.switch::after {
content: "";
position: absolute;
left: 3px;
top: 50%;
transform: translateY(-50%);
width: 16px;
height: 16px;
background-color: white;
border-radius: 50%;
transition: left 0.2s;
}
/* Checked States */
input.form-control.switch:checked + label.switch::before {
background-color: #4CAF50;
}
input.form-control.switch:checked + label.switch::after {
left: 25px;
}