@stnd/styles 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/README.md +116 -0
- package/TOKENS.md +415 -0
- package/_standard-00-reset.scss +74 -0
- package/_standard-00-variables.scss +54 -0
- package/_standard-01-token.scss +287 -0
- package/_standard-02-color.scss +683 -0
- package/_standard-03-typography.scss +411 -0
- package/_standard-04-grid.scss +314 -0
- package/_standard-05-rhythm.scss +57 -0
- package/_standard-06-prose.scss +289 -0
- package/_standard-07-base.scss +216 -0
- package/_standard-08-media.scss +216 -0
- package/_standard-09-lists.scss +103 -0
- package/_standard-10-tables.scss +49 -0
- package/_standard-11-forms.scss +343 -0
- package/_standard-12-code.scss +204 -0
- package/_standard-13-components.scss +1261 -0
- package/_standard-14-analog.scss +48 -0
- package/_standard-30-contrast.scss +42 -0
- package/_standard-31-print.scss +97 -0
- package/_standard-32-eink.scss +78 -0
- package/_standard-50-utilities.scss +1117 -0
- package/_standard-99-debug.scss +474 -0
- package/dist/obsidian.css +31 -0
- package/dist/obsidian.css.map +1 -0
- package/dist/standard.css +20 -0
- package/dist/standard.css.map +1 -0
- package/index.js +1 -0
- package/obsidian.scss +18 -0
- package/package.json +46 -0
- package/standard.scss +52 -0
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
@use "standard-00-variables" as *;
|
|
2
|
+
|
|
3
|
+
/* =========================== */
|
|
4
|
+
/* MEDIA */
|
|
5
|
+
/* =========================== */
|
|
6
|
+
|
|
7
|
+
img,
|
|
8
|
+
video,
|
|
9
|
+
audio,
|
|
10
|
+
iframe,
|
|
11
|
+
.video,
|
|
12
|
+
.video-container {
|
|
13
|
+
max-width: 100%;
|
|
14
|
+
border-radius: var(--radius);
|
|
15
|
+
box-shadow: var(--shadow-raised);
|
|
16
|
+
background: var(--color-surface);
|
|
17
|
+
max-height: 80vh;
|
|
18
|
+
border: var(--border);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* =========================== */
|
|
22
|
+
/* TYPOGRAPHIC NUANCES */
|
|
23
|
+
/* =========================== */
|
|
24
|
+
.video-container:has(video) {
|
|
25
|
+
position: relative;
|
|
26
|
+
/* padding-bottom: 56.25%; /* 16:9 aspect ratio */
|
|
27
|
+
border: none;
|
|
28
|
+
box-shadow: none;
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
background: transparent;
|
|
31
|
+
|
|
32
|
+
video {
|
|
33
|
+
border-radius: var(--radius);
|
|
34
|
+
border: var(--border);
|
|
35
|
+
box-shadow: var(--shadow-raised);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
iframe {
|
|
39
|
+
position: absolute;
|
|
40
|
+
top: 0;
|
|
41
|
+
left: 0;
|
|
42
|
+
width: 100%;
|
|
43
|
+
height: 100%;
|
|
44
|
+
border: 0;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.stnd-icon {
|
|
49
|
+
line-height: 0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.stnd-icon,
|
|
53
|
+
.stnd-icon img,
|
|
54
|
+
.stnd-icon svg {
|
|
55
|
+
box-shadow: none;
|
|
56
|
+
background: transparent;
|
|
57
|
+
border: none;
|
|
58
|
+
color: currentColor;
|
|
59
|
+
fill: currentColor;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* Reset padding for images specifically */
|
|
63
|
+
img {
|
|
64
|
+
padding: 0;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
figure {
|
|
68
|
+
display: grid;
|
|
69
|
+
gap: calc(var(--space-d4) * var(--space-2));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
figcaption {
|
|
73
|
+
font-size: var(--size-sm);
|
|
74
|
+
font-style: italic;
|
|
75
|
+
text-align: center;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* @component Image System
|
|
80
|
+
* @description Responsive image handling with interactive zoom functionality.
|
|
81
|
+
* This system is progressively enhanced. Without JavaScript, it provides a
|
|
82
|
+
* basic zoom-on-click-and-hold. With JavaScript, it provides a full
|
|
83
|
+
* feature-rich lightbox experience.
|
|
84
|
+
*
|
|
85
|
+
* @since 0.1.0
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
/* ================================================================ */
|
|
89
|
+
/* PART 1: BASE IMAGE STYLES */
|
|
90
|
+
/* These are the default styles for all images. */
|
|
91
|
+
/* ================================================================ */
|
|
92
|
+
|
|
93
|
+
/*
|
|
94
|
+
* The `:where` block keeps your original logic of only applying
|
|
95
|
+
* these base styles inside a `.rhythm` or `<html>` context.
|
|
96
|
+
*/
|
|
97
|
+
:where(html:not(.no-rhythm), .rhythm) {
|
|
98
|
+
/* Basic image reset */
|
|
99
|
+
* + img,
|
|
100
|
+
img,
|
|
101
|
+
img:first-child,
|
|
102
|
+
img:last-child {
|
|
103
|
+
margin: 0;
|
|
104
|
+
max-inline-size: 100%;
|
|
105
|
+
block-size: auto;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* Default styles for a zoomable image reset */
|
|
109
|
+
img:not([data-no-zoom]) {
|
|
110
|
+
max-width: 100%;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* Your cosmetic classes for adding/removing borders are preserved */
|
|
114
|
+
img.fx {
|
|
115
|
+
border-radius: var(--radius);
|
|
116
|
+
border: var(--border);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
img.nofx {
|
|
120
|
+
border-radius: unset;
|
|
121
|
+
border: unset;
|
|
122
|
+
box-shadow: unset;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* ================================================================ */
|
|
127
|
+
/* PART 2: NO-JAVASCRIPT FALLBACK (using :active) */
|
|
128
|
+
/* These rules only apply if the JavaScript has not run. */
|
|
129
|
+
/* They provide a simple "zoom-on-hold" experience. */
|
|
130
|
+
/* ================================================================ */
|
|
131
|
+
|
|
132
|
+
/* When JS is off, holding click on an image will trigger this zoom effect. */
|
|
133
|
+
html:not(.js-image-zoom-enabled) img:active {
|
|
134
|
+
cursor: zoom-out;
|
|
135
|
+
display: block;
|
|
136
|
+
position: fixed;
|
|
137
|
+
z-index: var(--z-image-zoom);
|
|
138
|
+
max-height: calc(100vh);
|
|
139
|
+
max-width: calc(100vw);
|
|
140
|
+
object-fit: contain;
|
|
141
|
+
margin: 0 auto;
|
|
142
|
+
top: 50%;
|
|
143
|
+
left: 50%;
|
|
144
|
+
transform: translate(-50%, -50%);
|
|
145
|
+
user-select: none;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* Creates a backdrop for the :active zoom. */
|
|
149
|
+
html:not(.js-image-zoom-enabled):has(img:active)::before {
|
|
150
|
+
content: "";
|
|
151
|
+
position: fixed;
|
|
152
|
+
inset: 0;
|
|
153
|
+
background: var(--color-background);
|
|
154
|
+
z-index: calc(var(--z-image-zoom) - 1);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* ================================================================ */
|
|
158
|
+
/* PART 3: JAVASCRIPT-ENHANCED STYLES (HTML overlay) */
|
|
159
|
+
/* These styles are used by the JavaScript class to create the full */
|
|
160
|
+
/* lightbox experience with keyboard navigation, etc. */
|
|
161
|
+
/* ================================================================ */
|
|
162
|
+
|
|
163
|
+
/* Lock the page scroll when the JS overlay is active
|
|
164
|
+
html.image-zoomed-active {
|
|
165
|
+
overflow: hidden;
|
|
166
|
+
}
|
|
167
|
+
*/
|
|
168
|
+
/* The overlay container created by the JS */
|
|
169
|
+
.image-zoom-overlay {
|
|
170
|
+
position: fixed;
|
|
171
|
+
inset: 0;
|
|
172
|
+
z-index: var(--z-image-zoom);
|
|
173
|
+
background: var(--color-glass);
|
|
174
|
+
backdrop-filter: var(--filter-glass);
|
|
175
|
+
display: flex;
|
|
176
|
+
align-items: center;
|
|
177
|
+
justify-content: center;
|
|
178
|
+
padding: var(--gap-body);
|
|
179
|
+
padding: var(--space-4);
|
|
180
|
+
margin: 0;
|
|
181
|
+
opacity: 0;
|
|
182
|
+
cursor: zoom-out !important;
|
|
183
|
+
transition: all var(--transition);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* The class added by JS to fade the overlay in */
|
|
187
|
+
.image-zoom-overlay.is-visible {
|
|
188
|
+
opacity: 1;
|
|
189
|
+
backdrop-filter: var(--filter-glass);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/* The image element inside the JS overlay */
|
|
193
|
+
.image-zoom-overlay img {
|
|
194
|
+
display: block;
|
|
195
|
+
max-width: 100%;
|
|
196
|
+
max-height: 100%;
|
|
197
|
+
object-fit: contain;
|
|
198
|
+
user-select: none;
|
|
199
|
+
cursor: zoom-out !important;
|
|
200
|
+
box-shadow: var(--shadow-raised), var(--shadow-glow);
|
|
201
|
+
opacity: 0;
|
|
202
|
+
transform: scale(0.96);
|
|
203
|
+
transition: opacity var(--transition), transform var(--transition);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.image-zoom-overlay.is-visible img {
|
|
207
|
+
opacity: 1;
|
|
208
|
+
transform: scale(1);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
@media (min-width: 768px) {
|
|
212
|
+
/* Global zoomable image cursor */
|
|
213
|
+
img:not([data-no-zoom]) {
|
|
214
|
+
cursor: zoom-in !important;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
@use "standard-00-variables" as *;
|
|
2
|
+
|
|
3
|
+
/* =========================== */
|
|
4
|
+
/* LISTS */
|
|
5
|
+
/* =========================== */
|
|
6
|
+
|
|
7
|
+
ul,
|
|
8
|
+
ol {
|
|
9
|
+
list-style: none;
|
|
10
|
+
padding-inline: var(--space);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* Nested lists */
|
|
14
|
+
li > ul,
|
|
15
|
+
li > ol {
|
|
16
|
+
padding-inline-start: var(--space);
|
|
17
|
+
margin-block-start: var(--space-d2);
|
|
18
|
+
margin-block-end: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* List items */
|
|
22
|
+
li {
|
|
23
|
+
position: relative;
|
|
24
|
+
margin: 0;
|
|
25
|
+
padding-inline-start: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
li + li {
|
|
29
|
+
margin-block-start: var(--space);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Unordered list bullets */
|
|
33
|
+
ul > li::before {
|
|
34
|
+
content: "•";
|
|
35
|
+
position: absolute;
|
|
36
|
+
top: 0;
|
|
37
|
+
left: calc(var(--space) * -1);
|
|
38
|
+
width: var(--space);
|
|
39
|
+
text-align: center;
|
|
40
|
+
font-size: 0.7em;
|
|
41
|
+
color: var(--color-subtle);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Ordered list numbers */
|
|
45
|
+
ol {
|
|
46
|
+
counter-reset: ol-counter;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
ol > li {
|
|
50
|
+
counter-increment: ol-counter;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
ol > li::before {
|
|
54
|
+
content: counter(ol-counter) ".";
|
|
55
|
+
position: absolute;
|
|
56
|
+
top: 0.1em;
|
|
57
|
+
left: calc(var(--space) * -1.25);
|
|
58
|
+
text-align: right;
|
|
59
|
+
color: var(--color-subtle);
|
|
60
|
+
font-variant-numeric: tabular-nums;
|
|
61
|
+
width: 1rlh;
|
|
62
|
+
font-size: var(--size-sm);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* Inline lists override - protects layouts using flex */
|
|
66
|
+
ul:where(.display-flex, [style*="display: flex"], [style*="display:flex"]) li,
|
|
67
|
+
ol:where(.display-flex, [style*="display: flex"], [style*="display:flex"]) li {
|
|
68
|
+
margin-block-end: 0;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* =========================== */
|
|
72
|
+
/* LIST UTILITIES */
|
|
73
|
+
/* =========================== */
|
|
74
|
+
|
|
75
|
+
.no-bullet,
|
|
76
|
+
.no-bullet ul {
|
|
77
|
+
list-style: none;
|
|
78
|
+
padding-inline-start: 0;
|
|
79
|
+
li::before {
|
|
80
|
+
display: none;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.compact {
|
|
85
|
+
--base-gap: var(--space-d2);
|
|
86
|
+
li + li {
|
|
87
|
+
margin-block-start: var(--space-d2);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.tight {
|
|
92
|
+
--base-gap: var(--space-d3);
|
|
93
|
+
li {
|
|
94
|
+
margin-block-end: var(--space-d3);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.relaxed {
|
|
99
|
+
--base-gap: var(--space-2);
|
|
100
|
+
li {
|
|
101
|
+
margin-block-end: var(--space-2);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
@use "standard-00-variables" as *;
|
|
2
|
+
|
|
3
|
+
/* =========================== */
|
|
4
|
+
/* TABLES */
|
|
5
|
+
/* =========================== */
|
|
6
|
+
|
|
7
|
+
table {
|
|
8
|
+
border-collapse: collapse;
|
|
9
|
+
width: 100%;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
tr {
|
|
13
|
+
padding: 0;
|
|
14
|
+
margin: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
th,
|
|
18
|
+
td {
|
|
19
|
+
text-align: left;
|
|
20
|
+
border: var(--border);
|
|
21
|
+
line-height: var(--line-height-compact);
|
|
22
|
+
padding: var(--space-d2);
|
|
23
|
+
font-size: var(--size-sm);
|
|
24
|
+
min-height: var(--line-height);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
th {
|
|
28
|
+
font-weight: var(--font-weight-bold, 600);
|
|
29
|
+
transition: background var(--transition);
|
|
30
|
+
background: var(--color-surface-low);
|
|
31
|
+
text-transform: uppercase;
|
|
32
|
+
letter-spacing: 0.05em;
|
|
33
|
+
}
|
|
34
|
+
caption {
|
|
35
|
+
font-weight: var(--font-weight-bold, bold);
|
|
36
|
+
text-align: left;
|
|
37
|
+
margin-block-end: var(--space-d2);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* Numeric alignment (Tabular Nums) */
|
|
41
|
+
.numeric {
|
|
42
|
+
text-align: right;
|
|
43
|
+
font-variant-numeric: tabular-nums;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* Zebra striping */
|
|
47
|
+
.striped tbody tr:nth-child(even) {
|
|
48
|
+
background: oklch(from var(--color-foreground) l c h / 0.03);
|
|
49
|
+
}
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
@use "standard-00-variables" as *;
|
|
2
|
+
|
|
3
|
+
/* =========================== */
|
|
4
|
+
/* FORMS */
|
|
5
|
+
/* =========================== */
|
|
6
|
+
|
|
7
|
+
/* Layout containers */
|
|
8
|
+
|
|
9
|
+
fieldset {
|
|
10
|
+
display: grid;
|
|
11
|
+
gap: 0;
|
|
12
|
+
border: var(--border);
|
|
13
|
+
border-radius: var(--radius);
|
|
14
|
+
padding: var(--space) !important;
|
|
15
|
+
background: color-mix(
|
|
16
|
+
in oklch,
|
|
17
|
+
var(--color-surface) 25%,
|
|
18
|
+
var(--color-background)
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
fieldset div,
|
|
23
|
+
fieldset p {
|
|
24
|
+
margin: 0;
|
|
25
|
+
padding: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
fieldset + button {
|
|
29
|
+
margin-block-start: var(--space);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
fieldset :last-child {
|
|
33
|
+
margin-block-end: 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
legend {
|
|
37
|
+
font-weight: var(--font-weight-bold, bold);
|
|
38
|
+
margin-inline-start: calc(var(--space-d2) * -1);
|
|
39
|
+
padding-inline: var(--space-d2);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Inputs */
|
|
43
|
+
input,
|
|
44
|
+
textarea {
|
|
45
|
+
width: 100%;
|
|
46
|
+
font-family: var(--font-interface), system-ui, sans-serif;
|
|
47
|
+
@extend %padding-text;
|
|
48
|
+
font-size: 1em;
|
|
49
|
+
border-radius: var(--radius-sm);
|
|
50
|
+
color: var(--color-foreground);
|
|
51
|
+
background: var(--color-surface);
|
|
52
|
+
/* shadcn-style raised effect */
|
|
53
|
+
border: var(--border);
|
|
54
|
+
box-shadow: var(--shadow-raised);
|
|
55
|
+
outline: var(--stroke-width) solid transparent;
|
|
56
|
+
outline-offset: var(--stroke-width);
|
|
57
|
+
transition: all var(--transition-fast);
|
|
58
|
+
|
|
59
|
+
&:hover {
|
|
60
|
+
background: var(--color-surface-high);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
text-shadow: none !important;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
select {
|
|
67
|
+
width: 100%;
|
|
68
|
+
font-family: var(--font-interface), system-ui, sans-serif;
|
|
69
|
+
font-family: var(--font-interface), system-ui, sans-serif;
|
|
70
|
+
font-weight: var(--font-weight);
|
|
71
|
+
padding: var(--space-d8) var(--space-d4);
|
|
72
|
+
font-size: 1em;
|
|
73
|
+
|
|
74
|
+
border-radius: var(--radius-sm);
|
|
75
|
+
color: var(--color-muted);
|
|
76
|
+
background-color: var(--color-surface);
|
|
77
|
+
border: var(--border);
|
|
78
|
+
box-shadow: var(--shadow-raised);
|
|
79
|
+
outline: none;
|
|
80
|
+
transition: all var(--transition-fast);
|
|
81
|
+
cursor: pointer;
|
|
82
|
+
text-align: left;
|
|
83
|
+
text-shadow: none !important;
|
|
84
|
+
text-box-trim: none;
|
|
85
|
+
|
|
86
|
+
appearance: none;
|
|
87
|
+
/* Match Combobox double-chevron */
|
|
88
|
+
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="rgba(150,150,150,0.5)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/></svg>');
|
|
89
|
+
background-repeat: no-repeat;
|
|
90
|
+
background-position: right var(--space-d8) center;
|
|
91
|
+
background-size: 1em;
|
|
92
|
+
padding-right: var(--space); /* Make space for the icon */
|
|
93
|
+
|
|
94
|
+
&:hover,
|
|
95
|
+
&:focus {
|
|
96
|
+
background-color: var(--color-surface-high);
|
|
97
|
+
color: var(--color-foreground);
|
|
98
|
+
border-color: var(--color-subtle);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
textarea {
|
|
103
|
+
resize: vertical;
|
|
104
|
+
min-height: var(--space-2);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
input::placeholder,
|
|
108
|
+
textarea::placeholder {
|
|
109
|
+
color: var(--color-subtle);
|
|
110
|
+
/* Change to your desired color */
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
input:focus,
|
|
114
|
+
textarea:focus {
|
|
115
|
+
outline: var(--stroke-width) solid
|
|
116
|
+
oklch(from var(--color-accent) l c h / 0.25);
|
|
117
|
+
outline-offset: calc(var(--stroke-width) * 2);
|
|
118
|
+
background: var(--color-surface-high);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
label {
|
|
122
|
+
margin-block-start: var(--space);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
label + :is(input, textarea, select) {
|
|
126
|
+
margin-block-start: 0;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
label {
|
|
130
|
+
display: flex;
|
|
131
|
+
align-items: center;
|
|
132
|
+
gap: var(--space-d2);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
fieldset *:not(legend) + :is(label, select, button, .btn-group) {
|
|
136
|
+
margin-block-start: var(--space);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
fieldset *:not(legend) + .btn-group {
|
|
140
|
+
margin-block-start: var(--space-2);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
input + :is(button, .btn-group) {
|
|
144
|
+
margin-block-start: var(--space-d2);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
fieldset label:has(input[type="checkbox"], input[type="radio"]) {
|
|
148
|
+
margin-block-start: var(--space);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* Checkbox/Radio */
|
|
152
|
+
input[type="checkbox"],
|
|
153
|
+
input[type="radio"] {
|
|
154
|
+
appearance: none;
|
|
155
|
+
-webkit-appearance: none;
|
|
156
|
+
box-sizing: content-box;
|
|
157
|
+
width: calc(var(--space-d8));
|
|
158
|
+
height: calc(var(--space-d2));
|
|
159
|
+
border: var(--border);
|
|
160
|
+
border-radius: var(--radius);
|
|
161
|
+
background-color: var(--color-surface);
|
|
162
|
+
cursor: pointer;
|
|
163
|
+
position: relative;
|
|
164
|
+
margin-inline-end: var(--space-d2);
|
|
165
|
+
|
|
166
|
+
/* Subtle inset with border */
|
|
167
|
+
box-shadow: var(--shadow-raised);
|
|
168
|
+
outline: 0;
|
|
169
|
+
transition: all var(--transition-fast);
|
|
170
|
+
|
|
171
|
+
&:hover {
|
|
172
|
+
/* Add subtle glow on hover */
|
|
173
|
+
background-color: var(--color-surface-high);
|
|
174
|
+
box-shadow: var(--shadow-raised);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
&:active {
|
|
178
|
+
/* Add subtle glow on hover */
|
|
179
|
+
background-color: var(--color-surface-low);
|
|
180
|
+
box-shadow: var(--shadow-inset);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
&:focus-visible {
|
|
184
|
+
outline: var(--stroke-width) solid var(--color-accent);
|
|
185
|
+
outline-offset: var(--stroke-width);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/* Checked state */
|
|
189
|
+
&:checked {
|
|
190
|
+
background-color: var(--color-accent);
|
|
191
|
+
/* Raised effect when checked, with accent border for clarity */
|
|
192
|
+
box-shadow: var(--shadow-raised);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
&:checked:hover {
|
|
196
|
+
box-shadow: var(--shadow-raised);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/* Checkmark using pseudo-element */
|
|
200
|
+
&:checked::after {
|
|
201
|
+
content: "";
|
|
202
|
+
position: absolute;
|
|
203
|
+
left: 38%;
|
|
204
|
+
top: 23%;
|
|
205
|
+
width: 25%;
|
|
206
|
+
height: 45%;
|
|
207
|
+
border: var(--stroke-width) solid var(--color-on-accent);
|
|
208
|
+
border-width: 0 var(--stroke-width-lg) var(--stroke-width-lg) 0;
|
|
209
|
+
transform: rotate(45deg);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
input[type="radio"] {
|
|
214
|
+
border-radius: 50%;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
input[type="checkbox"][role="switch"] {
|
|
218
|
+
--switch-height: calc(var(--space) - var(--space-d3));
|
|
219
|
+
--switch-width: calc(var(--switch-height) * 2);
|
|
220
|
+
--switch-padding: 2px;
|
|
221
|
+
|
|
222
|
+
appearance: none;
|
|
223
|
+
box-sizing: border-box; /* Reset content-box from base checkbox rule */
|
|
224
|
+
position: relative;
|
|
225
|
+
top: 0; /* Reset top: 50% from base checkbox rule */
|
|
226
|
+
width: var(--switch-width);
|
|
227
|
+
height: var(--switch-height);
|
|
228
|
+
border-radius: 9999px;
|
|
229
|
+
border: none;
|
|
230
|
+
cursor: pointer;
|
|
231
|
+
background: var(--color-surface-lowest);
|
|
232
|
+
box-shadow: var(--shadow-ring), var(--shadow-inset);
|
|
233
|
+
transition: background 0.2s;
|
|
234
|
+
|
|
235
|
+
&:hover {
|
|
236
|
+
box-shadow: var(--shadow-ring), var(--shadow-inset);
|
|
237
|
+
&::before {
|
|
238
|
+
background: var(--color-accent);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
&:focus-visible {
|
|
243
|
+
outline: 2px solid var(--color-accent);
|
|
244
|
+
outline-offset: 2px;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
&:disabled {
|
|
248
|
+
cursor: not-allowed;
|
|
249
|
+
opacity: 0.5;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/* Thumb */
|
|
253
|
+
&::before {
|
|
254
|
+
content: "";
|
|
255
|
+
position: absolute;
|
|
256
|
+
top: var(--switch-padding);
|
|
257
|
+
left: var(--switch-padding);
|
|
258
|
+
width: calc(var(--switch-height) - var(--switch-padding) * 2);
|
|
259
|
+
height: calc(var(--switch-height) - var(--switch-padding) * 2);
|
|
260
|
+
border-radius: 50%;
|
|
261
|
+
background: var(--color-surface-high);
|
|
262
|
+
box-shadow: var(--shadow-raised);
|
|
263
|
+
transition: all var(--transition-fast);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/* Suppress the checkmark ::after from the base checkbox rule */
|
|
267
|
+
&:checked::after {
|
|
268
|
+
content: none;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
&:checked {
|
|
272
|
+
background: var(--color-accent);
|
|
273
|
+
&::before {
|
|
274
|
+
background: var(--color-surface-high);
|
|
275
|
+
transform: translateX(calc(var(--switch-width) - var(--switch-height)));
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
&:checked:hover {
|
|
280
|
+
&::before {
|
|
281
|
+
background: var(--color-on-cce) !important;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
input[type="range"] {
|
|
287
|
+
-webkit-appearance: none;
|
|
288
|
+
/* Webkit/Blink */
|
|
289
|
+
appearance: none;
|
|
290
|
+
cursor: pointer;
|
|
291
|
+
/* Dimensions */
|
|
292
|
+
height: var(--space-half);
|
|
293
|
+
/* Adjust track height */
|
|
294
|
+
width: 100%;
|
|
295
|
+
border-radius: 9999px;
|
|
296
|
+
outline: none;
|
|
297
|
+
padding: 0;
|
|
298
|
+
box-shadow: var(--shadow-inset);
|
|
299
|
+
|
|
300
|
+
padding: 0;
|
|
301
|
+
/* Crucial: allows thumb to touch edges */
|
|
302
|
+
border: var(--border);
|
|
303
|
+
/* Crucial: removes text-input borders */
|
|
304
|
+
background-origin: border-box;
|
|
305
|
+
|
|
306
|
+
/*
|
|
307
|
+
* THE FILL MAGIC
|
|
308
|
+
* uses the --slider-value variable passed in the style attribute
|
|
309
|
+
*/
|
|
310
|
+
background: linear-gradient(
|
|
311
|
+
to right,
|
|
312
|
+
var(--color-background, var(--color-accent)) 0%,
|
|
313
|
+
var(--color-background, var(--color-accent)) var(--slider-value),
|
|
314
|
+
var(--color-red, var(--color-surface)) var(--slider-value),
|
|
315
|
+
var(--color-red, var(--color-surface)) 100%
|
|
316
|
+
);
|
|
317
|
+
background: var(--color-surface-lowest);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
input[type="range"]::-webkit-slider-thumb {
|
|
321
|
+
-webkit-appearance: none;
|
|
322
|
+
appearance: none;
|
|
323
|
+
height: calc(var(--space-half) + 2px);
|
|
324
|
+
width: calc(var(--space-half) + 2px);
|
|
325
|
+
border-radius: 50%;
|
|
326
|
+
border: none;
|
|
327
|
+
transition: var(--transition-fast);
|
|
328
|
+
|
|
329
|
+
background: var(--color-surface-high);
|
|
330
|
+
/* Raised effect for better grip affordance */
|
|
331
|
+
box-shadow: var(--shadow-raised);
|
|
332
|
+
|
|
333
|
+
/* Vertical alignment logic for Webkit:
|
|
334
|
+
(Thumb Height / 2) - (Track Height / 2) * -1
|
|
335
|
+
*/
|
|
336
|
+
margin-top: 0;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
input[type="range"]:hover::-webkit-slider-thumb {
|
|
340
|
+
background: var(--color-accent);
|
|
341
|
+
box-shadow: var(--shadow-raised), var(--shadow-lg);
|
|
342
|
+
cursor: pointer;
|
|
343
|
+
}
|