|
13 | 13 | select, textarea) { |
14 | 14 | --_input-bg: color-mix(in oklch, var(#{$prefix}surface-1), var(#{$prefix}surface-2) 20%); |
15 | 15 |
|
16 | | - padding: 0.5em 0.75em; |
| 16 | + padding: 0.5em 0.75em; // 0.5em: OP ~size-2; 0.75em: no OP match |
| 17 | + // OP normalize: padding-block: --size-1, padding-inline: --size-2 |
17 | 18 | min-height: calc(1em * 1.5 + 1em + 2px); // line-height + vertical padding + border |
18 | 19 | background-color: var(--_input-bg); |
19 | 20 | border: 1px solid var(#{$prefix}border); |
20 | 21 | border-radius: var(#{$prefix}radius); |
21 | 22 | color: var(#{$prefix}text); |
22 | 23 | font: inherit; |
23 | | - font-size: 1rem; // >=16px prevents iOS Safari auto-zoom on focus |
| 24 | + font-size: 1rem; // OP --size-3; >=16px prevents iOS Safari auto-zoom on focus |
24 | 25 | transition: border-color 0.2s, box-shadow 0.2s; |
25 | 26 | } |
26 | 27 |
|
|
51 | 52 | display: block; |
52 | 53 | margin-top: calc(var(#{$prefix}spacing) * -0.75); // pull up under the input |
53 | 54 | margin-bottom: var(#{$prefix}spacing); |
54 | | - font-size: 0.875em; |
| 55 | + font-size: 0.875em; // no OP match (7/8) |
55 | 56 | color: color-mix(in oklch, var(#{$prefix}text), transparent 40%); |
56 | 57 | } |
57 | 58 |
|
|
78 | 79 |
|
79 | 80 | :where(label) { |
80 | 81 | display: block; |
81 | | - margin-bottom: 0.25em; |
| 82 | + margin-bottom: 0.25em; // OP ~size-1 (em-relative) |
82 | 83 | } |
83 | 84 |
|
84 | 85 | :where(label:has(+ input, + select, + textarea)) { |
85 | | - font-weight: 600; |
| 86 | + font-weight: 600; // OP --font-weight-6 |
86 | 87 | } |
87 | 88 |
|
88 | 89 | // file and range are short/inline controls — increase the label gap to match |
89 | 90 | // the visual weight of the spacing above and beside them. |
90 | 91 | :where(label:has(+ [type="file"], + [type="range"])) { |
91 | | - margin-bottom: 0.5em; |
| 92 | + margin-bottom: 0.5em; // OP ~size-2 (em-relative) |
92 | 93 | } |
93 | 94 |
|
94 | 95 | // ----- Fieldset ----- |
|
109 | 110 | } |
110 | 111 |
|
111 | 112 | :where(legend) { |
112 | | - font-weight: 600; |
113 | | - padding-inline: 0.25em; |
| 113 | + font-weight: 600; // OP --font-weight-6 |
| 114 | + padding-inline: 0.25em; // OP ~size-1 (em-relative) |
114 | 115 | } |
115 | 116 |
|
116 | 117 | // ----- Checkbox & Radio ----- |
117 | 118 | // Use accent-color to tint native controls to match the primary color |
118 | 119 |
|
119 | 120 | :where([type="checkbox"], [type="radio"]) { |
120 | 121 | accent-color: var(#{$prefix}primary); |
121 | | - width: 1.125em; |
122 | | - height: 1.125em; |
| 122 | + width: 1.125em; // no OP match (OP normalize: --size-3 = 1rem) |
| 123 | + height: 1.125em; // no OP match (OP normalize: --size-3 = 1rem) |
123 | 124 | margin: 0; // Remove browser default margin so flex labels align flush left |
124 | 125 | } |
125 | 126 |
|
126 | 127 | :where(label:has([type="checkbox"], [type="radio"])) { |
127 | 128 | display: flex; |
128 | 129 | align-items: center; |
129 | | - gap: 0.35em; |
130 | | - margin-bottom: 0.5em; |
| 130 | + gap: 0.35em; // no OP match (near ~size-1) |
| 131 | + margin-bottom: 0.5em; // OP ~size-2 (em-relative) |
131 | 132 | } |
132 | 133 |
|
133 | 134 | // Last checkbox/radio label in a group drops its bottom margin |
|
139 | 140 | // ----- Search (pill shape) ----- |
140 | 141 |
|
141 | 142 | :where([type="search"]) { |
142 | | - border-radius: 5rem; |
143 | | - padding-inline: 1.25em; |
| 143 | + border-radius: 5rem; // OP --size-10 (pill) |
| 144 | + padding-inline: 1.25em; // OP ~size-4 (em-relative) |
144 | 145 | } |
145 | 146 |
|
146 | 147 | // ----- Range ----- |
|
170 | 171 | } |
171 | 172 |
|
172 | 173 | :where([type="file"])::file-selector-button { |
173 | | - padding: 0.5em 1em; |
174 | | - margin-right: 0.75em; |
175 | | - margin-inline-end: 0.75em; |
| 174 | + padding: 0.5em 1em; // OP ~size-2 ~size-3 (em-relative) |
| 175 | + margin-right: 0.75em; // no OP match (between ~size-2/~size-3) |
| 176 | + margin-inline-end: 0.75em; // no OP match (between ~size-2/~size-3) |
176 | 177 | background-color: var(#{$prefix}primary); |
177 | 178 | color: var(#{$prefix}primary-contrast); |
178 | 179 | border: 1px solid var(#{$prefix}primary); |
|
191 | 192 | // Natural width so picker icon stays near content (excluded from full-width rule above). |
192 | 193 | // appearance: none is applied outside @layer (see below) to fix iOS Safari sizing. |
193 | 194 | :where([type="date"], [type="month"], [type="week"], [type="time"], [type="datetime-local"]) { |
194 | | - min-width: 10em; // Prevent collapse when empty (e.g. time with no value) |
| 195 | + min-width: 10em; // no OP match; prevent collapse when empty (e.g. time with no value) |
195 | 196 | margin-bottom: var(#{$prefix}spacing); |
196 | 197 | } |
197 | 198 |
|
|
201 | 202 | --_color-size: calc(1em * 1.5 + 1em + 2px); // Match text input height |
202 | 203 | margin-bottom: var(#{$prefix}spacing); |
203 | 204 |
|
204 | | - --_color-pad: 0.25em; |
| 205 | + --_color-pad: 0.25em; // OP ~size-1 (em-relative) |
205 | 206 |
|
206 | 207 | height: var(--_color-size); |
207 | 208 | width: calc((var(--_color-size) - 2 * var(--_color-pad)) * 1.618 + 2 * var(--_color-pad)); // Golden ratio inner swatch |
|
229 | 230 | :where(label:has([type="checkbox"][role="switch"])) { |
230 | 231 | display: flex; |
231 | 232 | align-items: center; |
232 | | - gap: 0.5em; |
| 233 | + gap: 0.5em; // OP ~size-2 (em-relative) |
233 | 234 | } |
234 | 235 |
|
235 | 236 | :where([type="checkbox"][role="switch"]) { |
236 | 237 | appearance: none; |
237 | | - width: 2.5em; |
238 | | - height: 1.25em; |
239 | | - border-radius: 1em; |
| 238 | + width: 2.5em; // no OP match (custom switch width) |
| 239 | + height: 1.25em; // OP ~size-4 (em-relative) |
| 240 | + border-radius: 1em; // OP ~size-3 (pill, em-relative) |
240 | 241 | background-color: var(#{$prefix}border); |
241 | 242 | position: relative; |
242 | 243 | cursor: pointer; |
|
0 commit comments