@grafctory/skin 0.0.0-stage → 0.3.2
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/LICENSE +201 -0
- package/README.md +482 -2
- package/dist/index.core.d.ts +201 -0
- package/dist/index.core.d.ts.map +1 -0
- package/dist/index.core.js +17 -0
- package/dist/index.core.js.map +1 -0
- package/dist/index.css +130 -0
- package/dist/index.d.ts +432 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +184 -0
- package/dist/index.js.map +1 -0
- package/dist/markup/alerts.css +83 -0
- package/dist/markup/blocks.css +255 -0
- package/dist/markup/forms.css +552 -0
- package/dist/markup/headings.css +131 -0
- package/dist/markup/highlights.css +38 -0
- package/dist/markup/inlines.css +181 -0
- package/dist/markup/lists.css +202 -0
- package/dist/markup/reset.css +38 -0
- package/dist/markup/tables.css +87 -0
- package/dist/presets/inter.css +194 -0
- package/dist/presets/roboto.css +198 -0
- package/dist/tokens/borders.css +151 -0
- package/dist/tokens/borders.d.ts +61 -0
- package/dist/tokens/borders.d.ts.map +1 -0
- package/dist/tokens/borders.js +76 -0
- package/dist/tokens/borders.js.map +1 -0
- package/dist/tokens/colors.css +516 -0
- package/dist/tokens/colors.d.ts +172 -0
- package/dist/tokens/colors.d.ts.map +1 -0
- package/dist/tokens/colors.js +187 -0
- package/dist/tokens/colors.js.map +1 -0
- package/dist/tokens/elevations.css +110 -0
- package/dist/tokens/elevations.d.ts +54 -0
- package/dist/tokens/elevations.d.ts.map +1 -0
- package/dist/tokens/elevations.js +69 -0
- package/dist/tokens/elevations.js.map +1 -0
- package/dist/tokens/layers.css +57 -0
- package/dist/tokens/layers.d.ts +34 -0
- package/dist/tokens/layers.d.ts.map +1 -0
- package/dist/tokens/layers.js +49 -0
- package/dist/tokens/layers.js.map +1 -0
- package/dist/tokens/motions.css +91 -0
- package/dist/tokens/motions.d.ts +40 -0
- package/dist/tokens/motions.d.ts.map +1 -0
- package/dist/tokens/motions.js +55 -0
- package/dist/tokens/motions.js.map +1 -0
- package/dist/tokens/opacities.css +41 -0
- package/dist/tokens/opacities.d.ts +32 -0
- package/dist/tokens/opacities.d.ts.map +1 -0
- package/dist/tokens/opacities.js +47 -0
- package/dist/tokens/opacities.js.map +1 -0
- package/dist/tokens/palettes.css +546 -0
- package/dist/tokens/palettes.d.ts +140 -0
- package/dist/tokens/palettes.d.ts.map +1 -0
- package/dist/tokens/palettes.js +155 -0
- package/dist/tokens/palettes.js.map +1 -0
- package/dist/tokens/scalings.css +81 -0
- package/dist/tokens/scalings.d.ts +31 -0
- package/dist/tokens/scalings.d.ts.map +1 -0
- package/dist/tokens/scalings.js +46 -0
- package/dist/tokens/scalings.js.map +1 -0
- package/dist/tokens/spacings.css +78 -0
- package/dist/tokens/spacings.d.ts +34 -0
- package/dist/tokens/spacings.d.ts.map +1 -0
- package/dist/tokens/spacings.js +49 -0
- package/dist/tokens/spacings.js.map +1 -0
- package/dist/tokens/typography.css +156 -0
- package/dist/tokens/typography.d.ts +77 -0
- package/dist/tokens/typography.d.ts.map +1 -0
- package/dist/tokens/typography.js +92 -0
- package/dist/tokens/typography.js.map +1 -0
- package/dist/tokens/viewports.css +101 -0
- package/dist/tokens/viewports.d.ts +75 -0
- package/dist/tokens/viewports.d.ts.map +1 -0
- package/dist/tokens/viewports.js +90 -0
- package/dist/tokens/viewports.js.map +1 -0
- package/package.json +87 -4
|
@@ -0,0 +1,552 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright © 2023-2026 Metreeca srl
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/*
|
|
18
|
+
* The focus is marked by a drawn outline. It follows whatever contour the control already carries, its rounded
|
|
19
|
+
* corners included, and it survives a forced-colours pass, which a shadow does not: a page rendered in the system
|
|
20
|
+
* palette keeps the mark. The reset takes the platform ring away, so a control reaching the keyboard owes the mark,
|
|
21
|
+
* and one styled into a box of its own is marked around that box. A checkbox or a radio, whose corners the platform
|
|
22
|
+
* draws and no radius reaches, takes the platform ring instead, which follows those corners in the focus colour.
|
|
23
|
+
*
|
|
24
|
+
* The offset is stated wherever a mark is, the outline shorthand not carrying it. A control standing free is marked
|
|
25
|
+
* outside its edge. A control enclosed by a border is marked just inside it, on the control's own ground, so the
|
|
26
|
+
* mark never escapes the box to be clipped or covered by a neighbour, and stands out from a grey border it would
|
|
27
|
+
* barely darken if drawn over it. A component filling a control solid moves the mark clear outside its edge, since
|
|
28
|
+
* the focus colour holds its contrast against the page and against no saturated fill.
|
|
29
|
+
*
|
|
30
|
+
* A field carries both states at once as soon as an invalid value is being typed into it. The failure is told by the
|
|
31
|
+
* edge and the focus by the ring within it, so neither mark hides the other while the field holds the keyboard.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
button, input, textarea, select {
|
|
35
|
+
|
|
36
|
+
&:focus-visible {
|
|
37
|
+
outline: var(--skin--outline-focus);
|
|
38
|
+
outline-offset: calc(-3 * var(--skin--border-width));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* A button and a menu are boxed as a field is, so the controls of a form line up as one row of equal edges. */
|
|
44
|
+
|
|
45
|
+
button, select {
|
|
46
|
+
padding: var(--skin--spacing-025) var(--skin--spacing-050);
|
|
47
|
+
border-style: var(--skin--border-style);
|
|
48
|
+
border-radius: var(--skin--border-radius-025);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* A value, typed, picked or worked out, reads in the text colour, whatever colour the text around it takes. */
|
|
52
|
+
|
|
53
|
+
input, textarea, select, output {
|
|
54
|
+
color: var(--skin--color);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* Text being typed keeps the platform wrapping, so words already entered never jump between lines as more follow. */
|
|
58
|
+
|
|
59
|
+
textarea, [contenteditable] {
|
|
60
|
+
text-wrap-style: auto;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* A field's edge is what identifies it as one, so it takes the line held to the control boundary budget. */
|
|
64
|
+
|
|
65
|
+
input, textarea, select {
|
|
66
|
+
|
|
67
|
+
border-color: var(--skin--border-color-field);
|
|
68
|
+
|
|
69
|
+
/* A field that takes no input recedes as a disabled button does, its edge falling back to a decorative line. */
|
|
70
|
+
|
|
71
|
+
&:disabled {
|
|
72
|
+
color: var(--skin--color-disabled);
|
|
73
|
+
border-color: var(--skin--border-color);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/*
|
|
77
|
+
* A field that only shows its value drops the edge inviting a value to be typed, falling back to the decorative
|
|
78
|
+
* line as a disabled field does, but keeps its value in the text colour and its focus mark, so it reads as content
|
|
79
|
+
* still within reach rather than as a control set aside. The attribute is matched rather than `:read-only`, which
|
|
80
|
+
* also holds for every box, slider, swatch and file picker that takes no typing in the first place.
|
|
81
|
+
*/
|
|
82
|
+
|
|
83
|
+
&[readonly] {
|
|
84
|
+
border-color: var(--skin--border-color);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/*
|
|
88
|
+
* A value is judged once the reader has had a say on it, so a required field left empty on arrival is not yet
|
|
89
|
+
* marked as failed. A field the app itself rejects, as a server does a value its rules refuse, says so through
|
|
90
|
+
* aria-invalid, which assistive technology announces as well, and is marked the same way from the moment it is
|
|
91
|
+
* set. The field's own border takes the failure colour, so the failure reads as the edge of the field.
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
&:user-invalid, &[aria-invalid="true"] {
|
|
95
|
+
color: var(--skin--color-fail);
|
|
96
|
+
border-color: var(--skin--color-fail);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* A box ticked, a slider and a bar are painted in the colour of a control that answers, as part of the form. */
|
|
102
|
+
|
|
103
|
+
input, progress {
|
|
104
|
+
accent-color: var(--skin--color-enabled);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/*
|
|
108
|
+
* A bar keeps the look the platform draws it with, which Blink drops for a flat green one as soon as the bar is
|
|
109
|
+
* given a ground or a border of its own. The reset hands it both, so the bar takes back what the platform states.
|
|
110
|
+
*/
|
|
111
|
+
|
|
112
|
+
progress {
|
|
113
|
+
border: revert;
|
|
114
|
+
border-radius: revert;
|
|
115
|
+
background-color: revert;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/*
|
|
119
|
+
* A gauge is drawn flat, outlined in the decorative line as the platform outlines a progress bar, with its value in
|
|
120
|
+
* the colour of the form, in place of the bevelled green the platform paints it with. A value the author placed
|
|
121
|
+
* outside the optimum range takes the caution step of the meaning scale, and one at the far end the failure step.
|
|
122
|
+
*
|
|
123
|
+
* The bar and the room around it are rounded to whole pixels, the room downwards so it never grows past the spacing it
|
|
124
|
+
* is read from, and the bar keeps one offset from the outline wherever the meter falls on the pixel grid.
|
|
125
|
+
*
|
|
126
|
+
* The parts are reached through the pseudo-elements each engine exposes, there being no standard way to style them,
|
|
127
|
+
* and each is a rule of its own, since a selector naming a pseudo-element an engine does not know is dropped whole.
|
|
128
|
+
*/
|
|
129
|
+
|
|
130
|
+
meter {
|
|
131
|
+
|
|
132
|
+
/*
|
|
133
|
+
* The bar is held clear of the outline by the same room on every side, and both are rounded fully at the ends,
|
|
134
|
+
* the outline around the room as well as the bar, so the two curves run parallel. The height is stated for the
|
|
135
|
+
* bar, with the room and the outline added around it, as the measure the reader sees filling up.
|
|
136
|
+
*/
|
|
137
|
+
|
|
138
|
+
appearance: none;
|
|
139
|
+
box-sizing: content-box;
|
|
140
|
+
|
|
141
|
+
block-size: round(var(--skin--scaling-050), 1px);
|
|
142
|
+
padding: round(down, var(--skin--spacing-025), 1px);
|
|
143
|
+
border-style: var(--skin--border-style);
|
|
144
|
+
border-radius: calc(
|
|
145
|
+
round(var(--skin--scaling-050), 1px) / 2
|
|
146
|
+
+ round(down, var(--skin--spacing-025), 1px)
|
|
147
|
+
+ var(--skin--border-width)
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
background-color: transparent;
|
|
151
|
+
|
|
152
|
+
&::-webkit-meter-bar {
|
|
153
|
+
/* Blink centres the bar rather than stretching it to the meter, so the bar states its own height. */
|
|
154
|
+
|
|
155
|
+
block-size: round(var(--skin--scaling-050), 1px);
|
|
156
|
+
border-style: none;
|
|
157
|
+
background: none;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
&::-webkit-meter-optimum-value {
|
|
161
|
+
block-size: 100%;
|
|
162
|
+
border-radius: calc(round(var(--skin--scaling-050), 1px) / 2);
|
|
163
|
+
background: none;
|
|
164
|
+
background-color: var(--skin--color-enabled);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
&::-webkit-meter-suboptimum-value {
|
|
168
|
+
block-size: 100%;
|
|
169
|
+
border-radius: calc(round(var(--skin--scaling-050), 1px) / 2);
|
|
170
|
+
background: none;
|
|
171
|
+
background-color: var(--skin--color-warn);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
&::-webkit-meter-even-less-good-value {
|
|
175
|
+
block-size: 100%;
|
|
176
|
+
border-radius: calc(round(var(--skin--scaling-050), 1px) / 2);
|
|
177
|
+
background: none;
|
|
178
|
+
background-color: var(--skin--color-fail);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
&::-moz-meter-bar {
|
|
182
|
+
border-radius: calc(round(var(--skin--scaling-050), 1px) / 2);
|
|
183
|
+
background: none;
|
|
184
|
+
background-color: var(--skin--color-enabled);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
&:-moz-meter-sub-optimum::-moz-meter-bar {
|
|
188
|
+
background-color: var(--skin--color-warn);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
&:-moz-meter-sub-sub-optimum::-moz-meter-bar {
|
|
192
|
+
background-color: var(--skin--color-fail);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
input, textarea {
|
|
198
|
+
|
|
199
|
+
border-style: var(--skin--border-style);
|
|
200
|
+
border-radius: var(--skin--border-radius-025);
|
|
201
|
+
|
|
202
|
+
/* A field taking a typed line keeps it clear of the border. A box, a slider, a swatch and a picker do not. */
|
|
203
|
+
|
|
204
|
+
&:not(textarea, [type=checkbox], [type=radio], [type=range], [type=color], [type=file]) {
|
|
205
|
+
padding: var(--skin--spacing-025) var(--skin--spacing-050);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/* A text area keeps its paragraphs further from the border, so they read as a block of text set inside a box. */
|
|
209
|
+
|
|
210
|
+
&:is(textarea) {
|
|
211
|
+
padding: var(--skin--spacing-050);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/*
|
|
215
|
+
* A box ticked or picked is sized against the text it labels rather than at the size the platform fixes. Too
|
|
216
|
+
* small to be marked from within, it is marked from without, either mark closing over the tick as a ring.
|
|
217
|
+
*/
|
|
218
|
+
|
|
219
|
+
&:is([type=checkbox], [type=radio]) {
|
|
220
|
+
|
|
221
|
+
inline-size: var(--skin--scaling-100);
|
|
222
|
+
block-size: var(--skin--scaling-100);
|
|
223
|
+
|
|
224
|
+
/*
|
|
225
|
+
* The platform paints no border a failure could colour, so a failed box is ringed instead, held just clear
|
|
226
|
+
* of the box at the width the invalid outline token states. The focus ring takes its place while the box
|
|
227
|
+
* holds the keyboard, the one outline on offer going to the mark the reader is acting on.
|
|
228
|
+
*/
|
|
229
|
+
|
|
230
|
+
&:is(:user-invalid, [aria-invalid="true"]) {
|
|
231
|
+
outline: var(--skin--outline-invalid);
|
|
232
|
+
outline-offset: var(--skin--border-width);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/*
|
|
236
|
+
* The platform draws a box with corners of its own and drops any radius stated for it, so a drawn focus mark
|
|
237
|
+
* would square off around a rounded box. The mark takes the platform style instead, tracing the contour of the
|
|
238
|
+
* box in the focus colour at a width the browser settles, just clear of the box.
|
|
239
|
+
*/
|
|
240
|
+
|
|
241
|
+
&:focus-visible {
|
|
242
|
+
outline: var(--skin--outline-focus);
|
|
243
|
+
outline-style: auto;
|
|
244
|
+
outline-offset: var(--skin--border-width);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/*
|
|
250
|
+
* A box marked from without is lifted over the content following it, whose background would otherwise paint over
|
|
251
|
+
* the part of the ring drawn outside the box. The lift weighs only the element, so any rule positioning a box by
|
|
252
|
+
* an attribute or a class keeps its own value, as a hidden box given `data-offscreen` does.
|
|
253
|
+
*/
|
|
254
|
+
|
|
255
|
+
&:where([type=checkbox], [type=radio]):where(:user-invalid, [aria-invalid="true"], :focus-visible) {
|
|
256
|
+
position: relative;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/*
|
|
260
|
+
* The button clearing a search field is drawn as the lucide cross, in the colour of the value it clears, in place
|
|
261
|
+
* of the tinted glyph the platform paints. It is cropped to its stroke and centred on the value, as the arrow of a
|
|
262
|
+
* menu is, the stroke stated in the glyph since a mask cannot read a custom property.
|
|
263
|
+
*/
|
|
264
|
+
|
|
265
|
+
&::-webkit-search-cancel-button {
|
|
266
|
+
|
|
267
|
+
appearance: none;
|
|
268
|
+
|
|
269
|
+
inline-size: calc(var(--skin--scaling-100) * 14 / 24); /* The stroke spans 14 of the 24 grid units. */
|
|
270
|
+
block-size: calc(var(--skin--scaling-100) * 14 / 24);
|
|
271
|
+
margin-inline-start: var(--skin--spacing-050);
|
|
272
|
+
|
|
273
|
+
background-color: currentColor;
|
|
274
|
+
forced-color-adjust: none;
|
|
275
|
+
|
|
276
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='5 5 14 14' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E") no-repeat;
|
|
277
|
+
|
|
278
|
+
cursor: pointer;
|
|
279
|
+
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/*
|
|
283
|
+
* The part a date or time field draws its values in is cleared of its padding as every element is, so the field
|
|
284
|
+
* stands one line high inside its own padding and border like any other field, in the engines exposing the part.
|
|
285
|
+
*/
|
|
286
|
+
|
|
287
|
+
&::-webkit-datetime-edit-fields-wrapper {
|
|
288
|
+
padding: 0;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/*
|
|
292
|
+
* A date or time field shows the button opening its picker only while it is worked on, under the pointer or
|
|
293
|
+
* holding the keyboard, so a row of filled fields at rest reads as values rather than as controls. The button
|
|
294
|
+
* keeps its room while hidden, so the value stands still as the button comes and goes, and a field taking no
|
|
295
|
+
* input never shows it. The types are named since Blink draws the arrow of a suggestion list with the same part.
|
|
296
|
+
*/
|
|
297
|
+
|
|
298
|
+
&:is([type=date], [type=time], [type=datetime-local], [type=month], [type=week]) {
|
|
299
|
+
|
|
300
|
+
&::-webkit-calendar-picker-indicator {
|
|
301
|
+
visibility: hidden;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
&:enabled:not([readonly]):is(:hover, :focus)::-webkit-calendar-picker-indicator {
|
|
305
|
+
visibility: visible;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/* A file field is its button and the name it picked, so it carries no box of its own around the two. */
|
|
311
|
+
|
|
312
|
+
&[type=file] {
|
|
313
|
+
border-style: none;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/*
|
|
317
|
+
* A colour well holds its swatch clear of the edge by the same room on every side, in place of the uneven room
|
|
318
|
+
* the platform leaves. The well keeps the corners of a field and a button, and the swatch a tighter curve, an
|
|
319
|
+
* optical choice below the scale that reads as the same curve set inside. The room and the swatch corners are
|
|
320
|
+
* rounded to whole pixels, and the swatch draws no edge of its own, the edge of the well being the one a reader
|
|
321
|
+
* takes in as the boundary of the control, so the swatch never reads as a second box set inside the first.
|
|
322
|
+
*/
|
|
323
|
+
|
|
324
|
+
&[type=color] {
|
|
325
|
+
|
|
326
|
+
padding: round(var(--skin--spacing-025), 1px);
|
|
327
|
+
|
|
328
|
+
&::-webkit-color-swatch-wrapper {
|
|
329
|
+
padding: 0;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
&::-webkit-color-swatch {
|
|
333
|
+
border-style: none;
|
|
334
|
+
border-radius: round(var(--skin--border-radius-025) / 2, 1px);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
&::-moz-color-swatch {
|
|
338
|
+
border-style: none;
|
|
339
|
+
border-radius: round(var(--skin--border-radius-025) / 2, 1px);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/* The button a file field opens its picker with is boxed and spaced as any other button. */
|
|
347
|
+
|
|
348
|
+
::file-selector-button {
|
|
349
|
+
|
|
350
|
+
margin-inline-end: var(--skin--spacing-050);
|
|
351
|
+
padding: var(--skin--spacing-025) var(--skin--spacing-050);
|
|
352
|
+
border-style: var(--skin--border-style);
|
|
353
|
+
border-width: var(--skin--border-width);
|
|
354
|
+
border-color: var(--skin--border-color);
|
|
355
|
+
border-radius: var(--skin--border-radius-025);
|
|
356
|
+
|
|
357
|
+
background-color: transparent;
|
|
358
|
+
|
|
359
|
+
cursor: pointer;
|
|
360
|
+
|
|
361
|
+
&:hover {
|
|
362
|
+
color: var(--skin--color-hover);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
button {
|
|
368
|
+
|
|
369
|
+
display: flex;
|
|
370
|
+
flex-direction: row;
|
|
371
|
+
align-items: center;
|
|
372
|
+
column-gap: var(--skin--spacing-050);
|
|
373
|
+
|
|
374
|
+
background-color: transparent;
|
|
375
|
+
|
|
376
|
+
white-space: nowrap;
|
|
377
|
+
|
|
378
|
+
&:disabled {
|
|
379
|
+
color: var(--skin--color-disabled);
|
|
380
|
+
pointer-events: none;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
&:enabled {
|
|
384
|
+
|
|
385
|
+
cursor: pointer;
|
|
386
|
+
|
|
387
|
+
&:hover {
|
|
388
|
+
color: var(--skin--color-hover);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
&:active {
|
|
392
|
+
color: var(--skin--color-pressed);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/*
|
|
400
|
+
* A menu draws its arrow as a part of its own content, so the padding a rule states on the menu closes in on the
|
|
401
|
+
* arrow from the end, as it does on the label from the start. The arrow keeps a room of its own clear of the label,
|
|
402
|
+
* in place of the gap the platform sets, and still stands at the end of a menu stretched past its label. Label and
|
|
403
|
+
* arrow stand level with the middle of the menu, so one stretched taller than its label, as in a row of taller
|
|
404
|
+
* controls, keeps both centred rather than hung from the top. The platform list keeps its native look, the picker
|
|
405
|
+
* not being opted in. A browser without the base appearance keeps the native control whole, the arrow then taking
|
|
406
|
+
* whatever room the platform reserves for it beside the label, in a box the platform sizes and pads on its own.
|
|
407
|
+
*/
|
|
408
|
+
|
|
409
|
+
select {
|
|
410
|
+
|
|
411
|
+
appearance: base-select;
|
|
412
|
+
|
|
413
|
+
align-items: center;
|
|
414
|
+
column-gap: var(--skin--spacing-075);
|
|
415
|
+
|
|
416
|
+
/*
|
|
417
|
+
* The arrow is drawn as the lucide down chevron a component marks a disclosure with, at the height and stroke of
|
|
418
|
+
* an icon, and painted in the colour of the label through a mask cut to the box the icon takes. The box is
|
|
419
|
+
* cropped to the stroke, round caps included, so the empty sides of the glyph add nothing to the room before it
|
|
420
|
+
* or to the padding after it: the menu is spaced by what its rules state rather than by the drawing. The stroke
|
|
421
|
+
* is stated in the glyph at the width the stroke token ships with, a mask having no way to read a custom
|
|
422
|
+
* property. The arrow keeps the colour of the label under forced colours, which would otherwise paint the box it
|
|
423
|
+
* is cut from in the page colour and leave nothing on show where the arrow stood.
|
|
424
|
+
*/
|
|
425
|
+
|
|
426
|
+
&::picker-icon {
|
|
427
|
+
|
|
428
|
+
content: "";
|
|
429
|
+
|
|
430
|
+
margin-inline-start: auto;
|
|
431
|
+
|
|
432
|
+
/*
|
|
433
|
+
* An optical nudge below the spacing scale, in units of the grid the glyph is drawn on. A chevron carries its
|
|
434
|
+
* weight at the point, leaving its ends thin, so cropped to its stroke it still reads as standing clear of the
|
|
435
|
+
* end of the menu. Pressed two units into the padding after it, it reads as level with the label at the start.
|
|
436
|
+
*/
|
|
437
|
+
|
|
438
|
+
margin-inline-end: calc(var(--skin--scaling-100) * -2 / 24);
|
|
439
|
+
|
|
440
|
+
width: calc(var(--skin--scaling-100) * 14 / 24); /* The stroke spans 14 of the 24 units the glyph is drawn on. */
|
|
441
|
+
height: var(--skin--scaling-100);
|
|
442
|
+
|
|
443
|
+
background-color: currentColor;
|
|
444
|
+
forced-color-adjust: none;
|
|
445
|
+
|
|
446
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='5 0 14 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat;
|
|
447
|
+
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
*::placeholder {
|
|
453
|
+
color: var(--skin--color-placeholder);
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/*
|
|
457
|
+
* A menu has no placeholder attribute: its stand-in is a first option that is disabled and holds no value. While that
|
|
458
|
+
* option is shown, an enabled menu sets it in the placeholder colour a field gives its hint. Browsers take the same
|
|
459
|
+
* option as the placeholder of a required menu, so the faded hint marks exactly the menus a form holds as unanswered.
|
|
460
|
+
* An enabled option with no value, such as "Any" in a filter, is a real choice and keeps the text colour. A disabled
|
|
461
|
+
* menu keeps the disabled colour whatever option it shows, since it takes no answer from the reader at all.
|
|
462
|
+
*/
|
|
463
|
+
|
|
464
|
+
select:enabled:has(> option[value=""]:first-child:disabled:checked) {
|
|
465
|
+
|
|
466
|
+
color: var(--skin--color-placeholder);
|
|
467
|
+
|
|
468
|
+
/*
|
|
469
|
+
* Only the hint fades. Every other entry in the open list keeps the text colour, group labels and disabled options
|
|
470
|
+
* included, so nothing but the hint changes colour as a choice is made or cleared.
|
|
471
|
+
*/
|
|
472
|
+
|
|
473
|
+
& :is(optgroup, option:not(:checked)) {
|
|
474
|
+
color: var(--skin--color);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
/* The arrow keeps the text colour too, in a rule of its own: a browser lacking the part drops a list naming it. */
|
|
478
|
+
|
|
479
|
+
&::picker-icon {
|
|
480
|
+
color: var(--skin--color);
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
/*
|
|
486
|
+
* A label names its control in the text colour and the strong weight, so the name and its field read as one piece of
|
|
487
|
+
* the form, told apart by weight rather than by a second colour. A label is set smaller, reading as a caption
|
|
488
|
+
* on the field below rather than as a heading competing with the text around the form. A label wrapping its field
|
|
489
|
+
* stacks the text over the field, both aligned to the start, kept apart by a gap of their own in place of the single
|
|
490
|
+
* space between words, which would read as one run of text rather than as a name above its control.
|
|
491
|
+
*/
|
|
492
|
+
|
|
493
|
+
label {
|
|
494
|
+
|
|
495
|
+
color: var(--skin--color);
|
|
496
|
+
font-size: var(--skin--font-size-small);
|
|
497
|
+
font-weight: var(--skin--font-weight-strong);
|
|
498
|
+
|
|
499
|
+
&:has(:is(input, select, textarea, meter, progress, output)) {
|
|
500
|
+
display: inline-flex;
|
|
501
|
+
flex-direction: column;
|
|
502
|
+
align-items: start;
|
|
503
|
+
gap: var(--skin--spacing-025) var(--skin--spacing-050);
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
/*
|
|
507
|
+
* A label wrapping a box ticked or picked sets the text beside the box at the size of the text around it, lined up
|
|
508
|
+
* with the middle of the box rather than with its foot, where the box would otherwise ride above its text.
|
|
509
|
+
*/
|
|
510
|
+
|
|
511
|
+
&:has(:is([type=checkbox], [type=radio])) {
|
|
512
|
+
flex-direction: row;
|
|
513
|
+
align-items: center;
|
|
514
|
+
font-size: inherit;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
/* A control keeps the size and the weight of a value, whatever the label wrapping it is set in. */
|
|
518
|
+
|
|
519
|
+
& :is(input, select, textarea, button, meter, progress, output) {
|
|
520
|
+
font-size: var(--skin--font-size);
|
|
521
|
+
font-weight: var(--skin--font-weight);
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
/*
|
|
527
|
+
* A group of fields is framed by a rounded box in the decorative line, its caption set into the top edge where the
|
|
528
|
+
* platform breaks the border around it, so the fields read as one set and the caption as the name of that set. The
|
|
529
|
+
* frame keeps the fields clear of its line by the room a panel keeps from its content, and stretches no wider than
|
|
530
|
+
* the column it stands in, however wide the controls it gathers may be, so a long field never pushes it past the page.
|
|
531
|
+
*/
|
|
532
|
+
|
|
533
|
+
fieldset {
|
|
534
|
+
min-inline-size: 0;
|
|
535
|
+
padding: var(--skin--spacing-075) var(--skin--spacing-100) var(--skin--spacing-100);
|
|
536
|
+
border-style: var(--skin--border-style);
|
|
537
|
+
border-radius: var(--skin--border-radius-050);
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
/*
|
|
541
|
+
* The caption of a group is set as a label is, smaller than the text around it and in the strong weight, so a group
|
|
542
|
+
* and its fields are named alike, the caption standing apart by its place on the frame alone. It keeps a narrow gap
|
|
543
|
+
* on either side where it breaks the border, and is pulled back by that gap, so its text starts on the line the
|
|
544
|
+
* fields inside start on and the group reads down one edge from its name to the last of its fields.
|
|
545
|
+
*/
|
|
546
|
+
|
|
547
|
+
legend {
|
|
548
|
+
margin-inline-start: calc(-1 * var(--skin--spacing-025));
|
|
549
|
+
padding-inline: var(--skin--spacing-025);
|
|
550
|
+
font-size: var(--skin--font-size-small);
|
|
551
|
+
font-weight: var(--skin--font-weight-strong);
|
|
552
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright © 2023-2026 Metreeca srl
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/*
|
|
18
|
+
* A heading running over more than one line has its lines balanced in place of the page wrapping, so none is left
|
|
19
|
+
* holding a lone word. Only the style is set, so a heading inside a run kept on one line still stays on that line.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
h1, h2, h3, h4, h5, h6 {
|
|
23
|
+
clear: both;
|
|
24
|
+
text-wrap-style: balance;
|
|
25
|
+
font-weight: var(--skin--font-weight-strong);
|
|
26
|
+
font-family: var(--skin--font-family-heading);
|
|
27
|
+
letter-spacing: var(--skin--letter-spacing-heading);
|
|
28
|
+
text-transform: var(--skin--text-transform-heading);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
h1 {
|
|
32
|
+
padding-bottom: var(--skin--spacing-025);
|
|
33
|
+
border-bottom-style: var(--skin--border-style);
|
|
34
|
+
margin-bottom: var(--skin--spacing-100);
|
|
35
|
+
font-size: calc(var(--skin--font-size-heading) * 1.25); /* A ratio on the heading size, which no em step can express. */
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
* A top-level heading opening a new part of the text stands further off what precedes it than the block gap, so
|
|
39
|
+
* the break reads at a glance; one opening its container or titling a heading group adds no room of its own.
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
&:not(:first-child, hgroup > *) {
|
|
43
|
+
margin-top: var(--skin--spacing-150);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/*
|
|
49
|
+
* A lower heading stands as far off what precedes it whether that is a paragraph or a container with no margin of its
|
|
50
|
+
* own, so a section break reads the same wherever it falls. One opening its container, titling a heading group or
|
|
51
|
+
* following straight on from another heading adds none, since what holds or precedes it already sets it apart.
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
h2, h3, h4, h5, h6 {
|
|
55
|
+
&:not(:first-child, hgroup > *, :is(h1, h2, h3, h4, h5, h6) + *) {
|
|
56
|
+
margin-top: var(--skin--spacing-150);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/*
|
|
61
|
+
* Each level below the first is told from the next by one cue at a time, so a deep outline stays readable in a column
|
|
62
|
+
* without the sizes running away: the second stands just larger than the third, the fourth matches the third in size
|
|
63
|
+
* and departs from it in the quieter colour of a label, and the last two are set smaller still in that colour.
|
|
64
|
+
*/
|
|
65
|
+
|
|
66
|
+
h2 {
|
|
67
|
+
margin-bottom: var(--skin--spacing-075);
|
|
68
|
+
font-size: calc(var(--skin--font-size-heading) * 1.125); /* A ratio on the heading size, below the em steps. */
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
h3, h4 {
|
|
72
|
+
margin-bottom: var(--skin--spacing-050);
|
|
73
|
+
font-size: var(--skin--font-size-heading);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
h4 {
|
|
77
|
+
color: var(--skin--color-label);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
h5, h6 {
|
|
81
|
+
margin-bottom: var(--skin--spacing-050);
|
|
82
|
+
font-size: var(--skin--font-size-small);
|
|
83
|
+
color: var(--skin--color-label);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/*
|
|
87
|
+
* A heading group titles a page or a section, its heading set as display type with no rule beneath it. The whole
|
|
88
|
+
* group keeps to the prose measure, so its lead, set larger than the running text, holds fewer characters per line.
|
|
89
|
+
*/
|
|
90
|
+
|
|
91
|
+
hgroup {
|
|
92
|
+
|
|
93
|
+
max-inline-size: var(--skin--inline-size-prose);
|
|
94
|
+
margin-bottom: var(--skin--spacing-100);
|
|
95
|
+
|
|
96
|
+
& > :is(h1, h2, h3, h4, h5, h6) {
|
|
97
|
+
padding: 0;
|
|
98
|
+
border-bottom-style: none;
|
|
99
|
+
margin-bottom: var(--skin--spacing-025);
|
|
100
|
+
line-height: var(--skin--line-height-display);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
& > h1 {
|
|
104
|
+
margin-bottom: var(--skin--spacing-100);
|
|
105
|
+
font-size: calc(var(--skin--font-size-heading) * 2.5); /* A ratio on the heading size, as outside a group. */
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
& > h2 {
|
|
109
|
+
font-size: calc(var(--skin--font-size-heading) * 2); /* A ratio on the heading size, as outside a group. */
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* A paragraph ahead of the heading is an eyebrow, naming the part of the page in small capitals of the accent. */
|
|
113
|
+
|
|
114
|
+
& > p:has(~ :is(h1, h2, h3, h4, h5, h6)) {
|
|
115
|
+
margin-bottom: var(--skin--spacing-025);
|
|
116
|
+
font-size: var(--skin--font-size-small);
|
|
117
|
+
font-weight: var(--skin--font-weight-strong);
|
|
118
|
+
letter-spacing: var(--skin--letter-spacing-caps);
|
|
119
|
+
text-transform: var(--skin--text-transform-caps);
|
|
120
|
+
color: var(--skin--color-strong);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* A paragraph after the heading is a lead, saying what follows in a larger size and the quieter label colour. */
|
|
124
|
+
|
|
125
|
+
& > :is(h1, h2, h3, h4, h5, h6) ~ p {
|
|
126
|
+
margin-bottom: 0;
|
|
127
|
+
font-size: var(--skin--font-size-large);
|
|
128
|
+
color: var(--skin--color-label);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
}
|