@skirbi/pinta 0.0.32 → 0.0.33
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/Changes +20 -0
- package/README.md +38 -0
- package/lib/index.mjs +1 -1
- package/lib/themes/pinta.css +60 -15
- package/package.json +1 -1
package/Changes
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
Revision history for @skirbi/pinta
|
|
2
2
|
|
|
3
|
+
0.0.33 2026-08-26 00:11:19Z
|
|
4
|
+
|
|
5
|
+
* Checkboxes and radios are a fixed fraction of a field, and the fraction is
|
|
6
|
+
2/3.5.
|
|
7
|
+
|
|
8
|
+
* --skirbi-field-height, one token for the size of a field. It is the height
|
|
9
|
+
of a text input and a select, and the choice controls take their fraction
|
|
10
|
+
from it, so taller fields no longer mean sizing the checkboxes and radios
|
|
11
|
+
separately. Unset it resolves to the padding, border and line-height of the
|
|
12
|
+
shared control recipe. The textarea is left out: it is running text sized by
|
|
13
|
+
its rows. --skirbi-choice-size still overrides the choice controls on their
|
|
14
|
+
own, and --skirbi-choice-size-final is the resolved value the tick and the
|
|
15
|
+
dot are scaled from.
|
|
16
|
+
|
|
17
|
+
* --skirbi-control-line-height is deprecated, renamed to
|
|
18
|
+
--skirbi-field-line-height. It still works and is still read as the
|
|
19
|
+
fallback, so nothing breaks, but it will go in a later release. "control"
|
|
20
|
+
came from the [wc-control] attribute these selectors match, which is not a
|
|
21
|
+
connection a normal person would make.
|
|
22
|
+
|
|
3
23
|
0.0.32 2026-08-25 17:39:42Z
|
|
4
24
|
|
|
5
25
|
* semtic-grid[diptych] and [triptych] now stack to a single column below
|
package/README.md
CHANGED
|
@@ -312,6 +312,44 @@ Typography is opt-in and token-driven.
|
|
|
312
312
|
```
|
|
313
313
|
|
|
314
314
|
|
|
315
|
+
# Form control tokens
|
|
316
|
+
|
|
317
|
+
One token sizes a field:
|
|
318
|
+
|
|
319
|
+
```css
|
|
320
|
+
--skirbi-field-height
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
It is the height of a text input and of a select, and the checkboxes and
|
|
324
|
+
radios take 2/3.5 of it, so they sit well inside the height of the field
|
|
325
|
+
beside them rather than reading as a big empty box. A field is tall mostly
|
|
326
|
+
through padding, which a choice control does not have, so a ratio near 1
|
|
327
|
+
would track padding the box is not carrying. Set it once and all four
|
|
328
|
+
follow.
|
|
329
|
+
|
|
330
|
+
```css
|
|
331
|
+
[skirbi-theme] {
|
|
332
|
+
--skirbi-field-height: 3.5rem;
|
|
333
|
+
}
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
Unset, it works out to the padding, border and line-height of the shared
|
|
337
|
+
control recipe, which is what these controls have always measured. The
|
|
338
|
+
textarea is left out on purpose: it is running text sized by its rows.
|
|
339
|
+
|
|
340
|
+
Two knobs remain for the exceptions:
|
|
341
|
+
|
|
342
|
+
```css
|
|
343
|
+
--skirbi-choice-size
|
|
344
|
+
--skirbi-field-line-height
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
`--skirbi-choice-size` sizes the choice controls directly, for when 2/3.5 of
|
|
348
|
+
the field is not what you want. Either way the result lands in
|
|
349
|
+
`--skirbi-choice-size-final`, which is what the tick and the radio dot are
|
|
350
|
+
scaled from, so they follow the box whichever way it was set.
|
|
351
|
+
|
|
352
|
+
|
|
315
353
|
# Component recipes
|
|
316
354
|
|
|
317
355
|
Pinta ships light recipes for Semtic elements.
|
package/lib/index.mjs
CHANGED
package/lib/themes/pinta.css
CHANGED
|
@@ -2885,7 +2885,26 @@
|
|
|
2885
2885
|
* put, and the two ended up different heights for no visible reason.
|
|
2886
2886
|
* Naming a value close to normal makes them agree, because the one that
|
|
2887
2887
|
* ignores it was going to land here anyway. */
|
|
2888
|
-
|
|
2888
|
+
/* --skirbi-control-line-height is the old name for this and still
|
|
2889
|
+
* works, deprecated: "control" came from the [wc-control] attribute the
|
|
2890
|
+
* selectors match, which is not something a theme file makes obvious. */
|
|
2891
|
+
line-height: var(
|
|
2892
|
+
--skirbi-field-line-height,
|
|
2893
|
+
var(--skirbi-control-line-height, 1.25)
|
|
2894
|
+
);
|
|
2895
|
+
|
|
2896
|
+
/* The height a field ends up with, resolved once. Read by the block-size
|
|
2897
|
+
* below and by the choice controls, which take a fraction of it: they
|
|
2898
|
+
* match this selector as well, so they inherit the same answer rather
|
|
2899
|
+
* than recomputing it. em resolves per element, and these all take
|
|
2900
|
+
* `font: inherit` above, so it is the same number either way. */
|
|
2901
|
+
--skirbi-field-height-final: var(
|
|
2902
|
+
--skirbi-field-height,
|
|
2903
|
+
calc(
|
|
2904
|
+
1em * var(--skirbi-field-line-height, var(--skirbi-control-line-height, 1.25))
|
|
2905
|
+
+ 2 * 0.6rem + 2px
|
|
2906
|
+
)
|
|
2907
|
+
);
|
|
2889
2908
|
}
|
|
2890
2909
|
|
|
2891
2910
|
/* Belt-and-suspenders on top of the shared padding/border/line-height
|
|
@@ -2899,9 +2918,16 @@
|
|
|
2899
2918
|
* removes that degree of freedom instead of chasing it per browser. */
|
|
2900
2919
|
input[wc-control],
|
|
2901
2920
|
select[wc-control] {
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2921
|
+
/* --skirbi-field-height is the one number that sizes a field. It is the
|
|
2922
|
+
* height of a text input and a select, and the choice controls derive
|
|
2923
|
+
* theirs from it further down, so a theme that wants taller fields sets
|
|
2924
|
+
* this and the checkboxes and radios follow. Unset, it works out to the
|
|
2925
|
+
* padding, border and line-height stated above, which is what these
|
|
2926
|
+
* controls have always measured.
|
|
2927
|
+
*
|
|
2928
|
+
* Not the textarea: that is running text sized by its rows, and pinning
|
|
2929
|
+
* it to a single-line height would defeat the point of one. */
|
|
2930
|
+
block-size: var(--skirbi-field-height-final);
|
|
2905
2931
|
}
|
|
2906
2932
|
|
|
2907
2933
|
/* Except the textarea, which is real running text: 1.25 is tight for
|
|
@@ -3169,10 +3195,29 @@
|
|
|
3169
3195
|
appearance: none;
|
|
3170
3196
|
-webkit-appearance: none;
|
|
3171
3197
|
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3198
|
+
/* A fraction of a field, so a checkbox sits well inside the height of
|
|
3199
|
+
* the input beside it instead of reading as a big empty box. 2/3.5 is
|
|
3200
|
+
* that fraction because a field is tall mostly through padding, which a
|
|
3201
|
+
* choice control does not have: a ratio near 1 tracks padding the box is
|
|
3202
|
+
* not carrying and overshoots as fields get airier. Against the default
|
|
3203
|
+
* field it lands a little under 24px, and against a 3.5rem one it is
|
|
3204
|
+
* 2rem.
|
|
3205
|
+
*
|
|
3206
|
+
* The ratio is taken from the same expression the field height comes
|
|
3207
|
+
* from, so setting --skirbi-field-height moves both together and the two
|
|
3208
|
+
* stay in proportion. --skirbi-choice-size overrides the result outright.
|
|
3209
|
+
*
|
|
3210
|
+
* Resolved once here and read back everywhere below, including from the
|
|
3211
|
+
* ::before that draws the tick and the dot, which inherits it. */
|
|
3212
|
+
--skirbi-choice-size-final: var(
|
|
3213
|
+
--skirbi-choice-size,
|
|
3214
|
+
calc(var(--skirbi-field-height-final) * 2 / 3.5)
|
|
3215
|
+
);
|
|
3216
|
+
|
|
3217
|
+
inline-size: var(--skirbi-choice-size-final);
|
|
3218
|
+
block-size: var(--skirbi-choice-size-final);
|
|
3219
|
+
min-inline-size: var(--skirbi-choice-size-final);
|
|
3220
|
+
min-block-size: var(--skirbi-choice-size-final);
|
|
3176
3221
|
|
|
3177
3222
|
margin: 0;
|
|
3178
3223
|
padding: 0;
|
|
@@ -3226,7 +3271,7 @@
|
|
|
3226
3271
|
) input[wc-control][type="checkbox"] {
|
|
3227
3272
|
border-radius: var(
|
|
3228
3273
|
--skirbi-choice-radius,
|
|
3229
|
-
calc(var(--skirbi-choice-size
|
|
3274
|
+
calc(var(--skirbi-choice-size-final) * 0.267)
|
|
3230
3275
|
);
|
|
3231
3276
|
}
|
|
3232
3277
|
|
|
@@ -3245,12 +3290,12 @@
|
|
|
3245
3290
|
semtic-checkbox
|
|
3246
3291
|
) input[wc-control][type="checkbox"]::before {
|
|
3247
3292
|
content: "";
|
|
3248
|
-
inline-size: calc(var(--skirbi-choice-size
|
|
3249
|
-
block-size: calc(var(--skirbi-choice-size
|
|
3293
|
+
inline-size: calc(var(--skirbi-choice-size-final) * 0.373);
|
|
3294
|
+
block-size: calc(var(--skirbi-choice-size-final) * 0.693);
|
|
3250
3295
|
|
|
3251
3296
|
border: solid currentColor;
|
|
3252
|
-
border-width: 0 calc(var(--skirbi-choice-size
|
|
3253
|
-
calc(var(--skirbi-choice-size
|
|
3297
|
+
border-width: 0 calc(var(--skirbi-choice-size-final) * 0.147)
|
|
3298
|
+
calc(var(--skirbi-choice-size-final) * 0.147) 0;
|
|
3254
3299
|
|
|
3255
3300
|
transform: rotate(45deg) scale(0);
|
|
3256
3301
|
transform-origin: center;
|
|
@@ -3272,8 +3317,8 @@
|
|
|
3272
3317
|
semtic-radio
|
|
3273
3318
|
) input[wc-control][type="radio"]::before {
|
|
3274
3319
|
content: "";
|
|
3275
|
-
inline-size: calc(var(--skirbi-choice-size
|
|
3276
|
-
block-size: calc(var(--skirbi-choice-size
|
|
3320
|
+
inline-size: calc(var(--skirbi-choice-size-final) * 0.56);
|
|
3321
|
+
block-size: calc(var(--skirbi-choice-size-final) * 0.56);
|
|
3277
3322
|
border-radius: 50%;
|
|
3278
3323
|
background: currentColor;
|
|
3279
3324
|
|
package/package.json
CHANGED