x
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
<!-- Checkbox -->
<fieldset class="flex flex-col gap-half">
<legend class="sr-only">Settings</legend>
<div class="flex items-center gap">
<input type="checkbox" name="check_recents" id="check_recents" value="1" class="checkbox" />
<label class="text-sm" for="check_recents">Recents</label>
</div>
<div class="flex items-center gap">
<input type="checkbox" name="check_home" id="check_home" value="1" class="checkbox" />
<label class="text-sm" for="check_home">Home</label>
</div>
<div class="flex items-center gap">
<input type="checkbox" name="check_applications" id="check_applications" value="1" class="checkbox" />
<label class="text-sm" for="check_applications">Applications</label>
</div>
<div class="flex items-center gap">
<input type="checkbox" name="check_desktop" id="check_desktop" value="1" class="checkbox" />
<label class="text-sm" for="check_desktop">Desktop</label>
</div>
</fieldset>
<!-- Radio -->
<fieldset class="flex flex-col gap-half">
<legend class="sr-only">Settings</legend>
<div class="flex items-center gap">
<input type="radio" name="setting" id="setting_recents" value="recents" class="radio" />
<label class="text-sm" for="setting_recents">Recents</label>
</div>
<div class="flex items-center gap">
<input type="radio" name="setting" id="setting_home" value="home" class="radio" />
<label class="text-sm" for="setting_home">Home</label>
</div>
<div class="flex items-center gap">
<input type="radio" name="setting" id="setting_applications" value="applications" class="radio" />
<label class="text-sm" for="setting_applications">Applications</label>
</div>
<div class="flex items-center gap">
<input type="radio" name="setting" id="setting_desktop" value="desktop" class="radio" />
<label class="text-sm" for="setting_desktop">Desktop</label>
</div>
</fieldset>
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
<%# Checkbox %>
<fieldset class="flex flex-col gap-half">
<legend class="sr-only">Settings</legend>
<div class="flex items-center gap">
<%= check_box_tag :check_recents, class: "checkbox" %>
<%= label_tag :check_recents, "Recents", class: "text-sm" %>
</div>
<div class="flex items-center gap">
<%= check_box_tag :check_home, class: "checkbox" %>
<%= label_tag :check_home, "Home", class: "text-sm" %>
</div>
<div class="flex items-center gap">
<%= check_box_tag :check_applications, class: "checkbox" %>
<%= label_tag :check_applications, "Applications", class: "text-sm" %>
</div>
<div class="flex items-center gap">
<%= check_box_tag :check_desktop, class: "checkbox" %>
<%= label_tag :check_desktop, "Desktop", class: "text-sm" %>
</div>
</fieldset>
<%# Radio %>
<fieldset class="flex flex-col gap-half">
<legend class="sr-only">Settings</legend>
<div class="flex items-center gap">
<%= radio_button_tag :setting, :recents, class: "radio" %>
<%= label_tag :setting_recents, "Recents", class: "text-sm" %>
</div>
<div class="flex items-center gap">
<%= radio_button_tag :setting, :home, class: "radio" %>
<%= label_tag :setting_home, "Home", class: "text-sm" %>
</div>
<div class="flex items-center gap">
<%= radio_button_tag :setting, :applications, class: "radio" %>
<%= label_tag :setting_applications, "Applications", class: "text-sm" %>
</div>
<div class="flex items-center gap">
<%= radio_button_tag :setting, :desktop, class: "radio" %>
<%= label_tag :setting_desktop, "Desktop", class: "text-sm" %>
</div>
</fieldset>
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
.input {
appearance: none;
background-color: var(--input-background, var(--color-bg));
border: 1px solid var(--input-border-color, var(--color-border));
border-radius: var(--input-radius, var(--rounded-md));
font-size: var(--input-font-size, var(--text-sm));
inline-size: var(--size-full);
padding: var(--input-padding, 0.5rem 1rem);
option {
padding-block: 2px;
}
&:is(textarea[rows=auto]) {
field-sizing: content;
max-block-size: calc(10lh + var(--size-6));
min-block-size: calc(3lh + var(--size-6));
}
&:is(select):not([multiple], [size]) {
background-image: url("select-arrow.svg");
background-position: center right var(--size-2);
background-repeat: no-repeat;
background-size: var(--size-4) auto;
}
&::file-selector-button {
font-weight: var(--font-medium);
margin-inline-end: var(--size-2);
}
&:user-invalid {
border-color: var(--color-negative);
}
&:user-invalid ~ .invalid-feedback {
display: flex;
}
&:disabled {
cursor: not-allowed;
opacity: var(--opacity-50);
}
}
/* Hide invalid feedback by default */
.invalid-feedback {
display: none;
}
/* Containers that act like (and contain) inputs */
.input--actor {
input {
border: 0; inline-size: 100%; outline: 0;
}
img:not([class]) {
filter: var(--input-icon-color, var(--color-filter-text));
}
&:focus-within {
outline: var(--input-outline-size, 2px) solid var(--color-selected-dark);
outline-offset: var(--border-2);
}
}
/* Checkbox, radio, and range */
.checkbox, .radio {
accent-color: var(--color-primary); transform: scale(1.15);
}
.range {
accent-color: var(--color-primary);
}
/* Styles that are shared between components */
:is(.input, .checkbox, .radio, .range) {
&:focus-visible {
outline: var(--input-outline-size, 2px) solid var(--color-selected-dark);
outline-offset: var(--border-2);
}
.field_with_errors & {
border-color: var(--color-negative);
}
}
Java Script is not required or multiple files are needed, check the notes.