@skirbi/pinta 0.0.33 → 0.0.34
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 +16 -2
- package/README.md +28 -0
- package/lib/index.mjs +1 -1
- package/lib/themes/pinta.css +35 -85
- package/package.json +1 -1
package/Changes
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
Revision history for @skirbi/pinta
|
|
2
2
|
|
|
3
|
+
0.0.34 2026-09-09 05:03:02Z
|
|
4
|
+
|
|
5
|
+
* :user-invalid fields are styled, so a field failing the browser's own
|
|
6
|
+
constraint validation reads the same as one carrying a [semtic-error]
|
|
7
|
+
message: error colour on the control border, the focus ring and the label.
|
|
8
|
+
:user-invalid rather than :invalid, so the browser holds it back until the
|
|
9
|
+
field has been left or a submit has been attempted, instead of marking a
|
|
10
|
+
half-typed value wrong on the second keystroke.
|
|
11
|
+
|
|
12
|
+
Only a real message still earns the host its wash and padding. That is what
|
|
13
|
+
label-error-position lays out and what changes the size of the field, and a
|
|
14
|
+
native invalid state has no message to place, so it stays inside the box it
|
|
15
|
+
has and nothing shifts as the user tabs out.
|
|
16
|
+
|
|
17
|
+
* Add updates that tatuahe needs
|
|
18
|
+
|
|
3
19
|
0.0.33 2026-08-26 00:11:19Z
|
|
4
20
|
|
|
5
21
|
* Checkboxes and radios are a fixed fraction of a field, and the fraction is
|
|
@@ -43,8 +59,6 @@ Revision history for @skirbi/pinta
|
|
|
43
59
|
which only gets the marker in its own mobile dropdown. The character is
|
|
44
60
|
now the `--skirbi-nav-marker` token, shared by both.
|
|
45
61
|
|
|
46
|
-
*
|
|
47
|
-
|
|
48
62
|
0.0.31 2026-08-15 04:29:13Z
|
|
49
63
|
|
|
50
64
|
* Align checkbox/radio colors with the text-input color scheme and make
|
package/README.md
CHANGED
|
@@ -350,6 +350,34 @@ the field is not what you want. Either way the result lands in
|
|
|
350
350
|
scaled from, so they follow the box whichever way it was set.
|
|
351
351
|
|
|
352
352
|
|
|
353
|
+
# Invalid fields
|
|
354
|
+
|
|
355
|
+
A field reads as wrong in two cases, drawn the same way:
|
|
356
|
+
|
|
357
|
+
* `[semtic-error]` holds a message
|
|
358
|
+
* the browser's own constraint validation fails, e.g. `pattern`, `required`,
|
|
359
|
+
`type`, `min`/`max`
|
|
360
|
+
|
|
361
|
+
The second uses `:user-invalid`, not `:invalid`, so the browser holds the
|
|
362
|
+
styling back until the field has been left or a submit has been attempted. A
|
|
363
|
+
half-typed value is not marked wrong on the second keystroke, and a required
|
|
364
|
+
field is not red before it has ever been filled in.
|
|
365
|
+
|
|
366
|
+
The control border, its focus ring and the label take the error colour in both
|
|
367
|
+
cases. Only a real message also gets the host its wash and padding, because
|
|
368
|
+
that is what `label-error-position` lays out and what changes the size of the
|
|
369
|
+
field: a native invalid state stays inside the box it already has, so nothing
|
|
370
|
+
moves as the user tabs out of it.
|
|
371
|
+
|
|
372
|
+
```css
|
|
373
|
+
--skirbi-error-base
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
Note that constraint validation only runs on a native form submission. A form
|
|
377
|
+
submitted from script, e.g. a framework binding on a button, never triggers it,
|
|
378
|
+
so `:user-invalid` there only fires once a field has been left.
|
|
379
|
+
|
|
380
|
+
|
|
353
381
|
# Component recipes
|
|
354
382
|
|
|
355
383
|
Pinta ships light recipes for Semtic elements.
|
package/lib/index.mjs
CHANGED
package/lib/themes/pinta.css
CHANGED
|
@@ -564,6 +564,8 @@
|
|
|
564
564
|
var(--skirbi-quaternary-main) 30%, black);
|
|
565
565
|
--skirbi-quaternary-contrast: var(--skirbi-on-dark);
|
|
566
566
|
|
|
567
|
+
--skirbi-nav-mobile-bg: 'transparent';
|
|
568
|
+
|
|
567
569
|
/* Deprecated knobs */
|
|
568
570
|
--skirbi-primary-light: var(--skirbi-primary-soft);
|
|
569
571
|
--skirbi-primary-dark: var(--skirbi-primary-strong);
|
|
@@ -1813,6 +1815,7 @@
|
|
|
1813
1815
|
* | `--skirbi-nav-mobile-item-active-bg` | Background of an item tile while pressed. |
|
|
1814
1816
|
*/
|
|
1815
1817
|
|
|
1818
|
+
|
|
1816
1819
|
/* semtic-nav */
|
|
1817
1820
|
[skirbi-theme] {
|
|
1818
1821
|
semtic-nav > nav {
|
|
@@ -1975,34 +1978,13 @@
|
|
|
1975
1978
|
}
|
|
1976
1979
|
}
|
|
1977
1980
|
|
|
1978
|
-
/* 48rem, matching the diptych/triptych stacking breakpoint below --
|
|
1979
|
-
* this used to be 47.999rem, a fraction under, which meant a page
|
|
1980
|
-
* combining this nav with a diptych/triptych (every real page in
|
|
1981
|
-
* eekboek-www, for one) had its layout stack and its nav collapse at
|
|
1982
|
-
* two DIFFERENT widths, with a sliver of viewport width where one
|
|
1983
|
-
* had already responded and the other hadn't yet. */
|
|
1984
1981
|
@media (max-width: 48rem) {
|
|
1985
|
-
/* A 2-column/2-row grid, not flex-wrap -- flex-wrap only breaks a
|
|
1986
|
-
* line once the current line actually runs out of room, so
|
|
1987
|
-
* whether [semtic-nav-links] (however wide its own content makes
|
|
1988
|
-
* it) landed on the bar's own line or wrapped below it depended on
|
|
1989
|
-
* viewport width: wide enough for toggle+brand+links together
|
|
1990
|
-
* (roughly 511-767px, with eekboek-www's own item list) and it
|
|
1991
|
-
* sat right next to the brand instead of below it. Explicit grid
|
|
1992
|
-
* placement makes "toggle+brand on row 1, links on row 2" true at
|
|
1993
|
-
* every width in this query, never a function of how much content
|
|
1994
|
-
* happens to fit. */
|
|
1995
1982
|
semtic-nav > nav {
|
|
1996
1983
|
display: grid;
|
|
1997
1984
|
grid-template-columns: auto 1fr;
|
|
1998
1985
|
align-items: center;
|
|
1999
1986
|
}
|
|
2000
1987
|
|
|
2001
|
-
/* hamburger="right" swaps the two columns' roles rather than just
|
|
2002
|
-
* reordering within a fixed track list -- with the toggle's own
|
|
2003
|
-
* column staying `auto`-sized and the other `1fr`, either side
|
|
2004
|
-
* gets the same "hug the button, give the brand the rest" sizing
|
|
2005
|
-
* regardless of which one it is. */
|
|
2006
1988
|
semtic-nav[hamburger="right"] > nav {
|
|
2007
1989
|
grid-template-columns: 1fr auto;
|
|
2008
1990
|
}
|
|
@@ -2017,17 +1999,6 @@
|
|
|
2017
1999
|
grid-column: 2;
|
|
2018
2000
|
}
|
|
2019
2001
|
|
|
2020
|
-
/* Nothing to open -- a brand-only nav (no items authored at all)
|
|
2021
|
-
* would otherwise still show a toggle that reveals an empty panel.
|
|
2022
|
-
* Relies on semtic-nav.mjs's own connectedCallbackSugar dropping
|
|
2023
|
-
* whitespace-only text nodes rather than moving them into
|
|
2024
|
-
* [semtic-nav-links] -- otherwise a stray newline left over from
|
|
2025
|
-
* the authored HTML's own formatting (e.g. between the brand and
|
|
2026
|
-
* an `<%= include ... %>` that rendered nothing while logged out)
|
|
2027
|
-
* would keep this from ever matching `:empty`. (`:has(*)` inside
|
|
2028
|
-
* this same :has() would have sufficed too and dodged that
|
|
2029
|
-
* dependency, but :has() can't nest inside :has() -- invalid
|
|
2030
|
-
* selector, silently never matches.) */
|
|
2031
2002
|
semtic-nav:has(> nav > [semtic-nav-links]:empty) > nav > [semtic-nav-toggle] {
|
|
2032
2003
|
display: none;
|
|
2033
2004
|
}
|
|
@@ -2045,50 +2016,20 @@
|
|
|
2045
2016
|
display: none;
|
|
2046
2017
|
}
|
|
2047
2018
|
|
|
2048
|
-
/* A 3-per-row grid, not a single stacked column -- with a longer
|
|
2049
|
-
* item list (see eekboek-www's Sales/Purchases/Bank/... top nav)
|
|
2050
|
-
* one-per-line ran the open dropdown well past the fold before the
|
|
2051
|
-
* last couple of items were even reachable. The grid lands on
|
|
2052
|
-
* [semtic-nav-links] itself, so it doesn't matter whether the
|
|
2053
|
-
* items are its direct children (the bare-items case this
|
|
2054
|
-
* component's own tests use) or grouped under an authored <ul>
|
|
2055
|
-
* (a common pattern; see eekboek-www's main_nav.html.ep) -- an
|
|
2056
|
-
* authored <ul> is flattened out of the box model entirely
|
|
2057
|
-
* (`display: contents`) so its <li>s become grid items of
|
|
2058
|
-
* [semtic-nav-links] directly, same as the bare-items case. */
|
|
2059
2019
|
semtic-nav[semtic-nav-open] > nav > [semtic-nav-links] {
|
|
2060
2020
|
display: grid;
|
|
2061
2021
|
grid-column: 1 / -1;
|
|
2062
2022
|
grid-row: 2;
|
|
2063
|
-
/* Tiles size to their own label, not stretched to fill an equal
|
|
2064
|
-
* share of the row -- `justify-self: center` (not `justify-
|
|
2065
|
-
* content`, which centers tracks WITHIN a box, not the box
|
|
2066
|
-
* itself) then centers the now content-sized box within its
|
|
2067
|
-
* full-width grid area, same idea as `margin: auto` on a block
|
|
2068
|
-
* box but the grid-native way to do it for a grid ITEM. */
|
|
2069
2023
|
justify-self: center;
|
|
2070
2024
|
width: fit-content;
|
|
2071
2025
|
grid-template-columns: repeat(3, max-content);
|
|
2072
|
-
gap: 0.25rem;
|
|
2073
|
-
/* A real panel, not a see-through overlay on whatever's
|
|
2074
|
-
* scrolled underneath -- the dropdown sits on top of page
|
|
2075
|
-
* content (it's still inside <nav>, not a separate layer), so
|
|
2076
|
-
* without an opaque background the open menu's own text and
|
|
2077
|
-
* the page's own would visually run together. */
|
|
2078
2026
|
background: var(--skirbi-nav-mobile-bg, var(--skirbi-surface-bg-final));
|
|
2079
|
-
border: 1px solid var(--skirbi-nav-mobile-border, var(--skirbi-surface-border-final));
|
|
2080
|
-
border-radius: 0.5rem;
|
|
2081
|
-
padding: 0.75rem;
|
|
2082
|
-
margin-block-start: 0.75rem;
|
|
2083
2027
|
}
|
|
2084
2028
|
|
|
2085
2029
|
semtic-nav[semtic-nav-open] > nav > [semtic-nav-links] > ul {
|
|
2086
2030
|
display: contents;
|
|
2087
2031
|
}
|
|
2088
2032
|
|
|
2089
|
-
/* The inline "𐄁" separator between items reads fine in a single
|
|
2090
|
-
* row; stacked one-per-line in the open dropdown it just leaves a
|
|
2091
|
-
* stray mark floating before each label. */
|
|
2092
2033
|
semtic-nav[semtic-nav-open] semtic-nav-item + semtic-nav-item::before {
|
|
2093
2034
|
content: none;
|
|
2094
2035
|
}
|
|
@@ -2110,13 +2051,8 @@
|
|
|
2110
2051
|
));
|
|
2111
2052
|
}
|
|
2112
2053
|
|
|
2113
|
-
/* Topbar links otherwise have no marker at all (that's only ever
|
|
2114
|
-
* been a sidenav-submenu thing, see the nested-children rule
|
|
2115
|
-
* further down) -- the mobile dropdown tile needs its own "leads
|
|
2116
|
-
* somewhere" affordance since it doesn't get one from anywhere
|
|
2117
|
-
* else. */
|
|
2118
2054
|
semtic-nav[semtic-nav-open] > nav > [semtic-nav-links] [semtic-nav-link]:not([semtic-nav-heading])::before {
|
|
2119
|
-
content: var(--skirbi-nav-marker, '
|
|
2055
|
+
content: var(--skirbi-nav-marker, '');
|
|
2120
2056
|
opacity: 0.5;
|
|
2121
2057
|
font-size: 1em;
|
|
2122
2058
|
}
|
|
@@ -2142,25 +2078,16 @@
|
|
|
2142
2078
|
:is(semtic-nav-item, semtic-nav-item-group) [semtic-nav-link] {
|
|
2143
2079
|
display: flex;
|
|
2144
2080
|
|
|
2145
|
-
/* Start, not center: a label that wraps to two lines would otherwise
|
|
2146
|
-
* center the marker against the whole block, leaving it floating
|
|
2147
|
-
* between the lines instead of sitting with the first one. */
|
|
2148
2081
|
align-items: flex-start;
|
|
2149
2082
|
|
|
2150
|
-
/*
|
|
2151
|
-
* header longer than the sidenav was cut off rather than wrapped.
|
|
2152
|
-
* break-word covers the case a single token is wider than the column,
|
|
2153
|
-
* which nothing else can rescue. */
|
|
2083
|
+
/* These two mess a bit with horizontal navigation bars */
|
|
2154
2084
|
white-space: normal;
|
|
2085
|
+
width: 100%;
|
|
2086
|
+
/* end messing */
|
|
2087
|
+
|
|
2155
2088
|
overflow-wrap: break-word;
|
|
2156
2089
|
overflow: visible;
|
|
2157
2090
|
|
|
2158
|
-
/* A group header with no href renders as a <button>, so it picks up the
|
|
2159
|
-
* button recipe -- which centers its content. Combined with the
|
|
2160
|
-
* width: 100% below, that centered a group's label in the row instead
|
|
2161
|
-
* of starting it where every other label starts. The rest of that
|
|
2162
|
-
* recipe is already undone further down (text-transform, letter-spacing,
|
|
2163
|
-
* background, border, font); this is the piece that was missed. */
|
|
2164
2091
|
justify-content: flex-start;
|
|
2165
2092
|
|
|
2166
2093
|
gap: 0.375rem;
|
|
@@ -2175,7 +2102,6 @@
|
|
|
2175
2102
|
cursor: pointer;
|
|
2176
2103
|
font: inherit;
|
|
2177
2104
|
font-size: 0.9rem;
|
|
2178
|
-
width: 100%;
|
|
2179
2105
|
text-align: left;
|
|
2180
2106
|
transition:
|
|
2181
2107
|
background var(--skirbi-transition-duration, 160ms)
|
|
@@ -2330,7 +2256,7 @@
|
|
|
2330
2256
|
flex: 1;
|
|
2331
2257
|
}
|
|
2332
2258
|
|
|
2333
|
-
@media (max-width:
|
|
2259
|
+
@media (max-width: 64rem) {
|
|
2334
2260
|
position: fixed;
|
|
2335
2261
|
inset: 0;
|
|
2336
2262
|
z-index: 40;
|
|
@@ -2822,7 +2748,11 @@
|
|
|
2822
2748
|
semtic-input:has([semtic-error]:not(:empty)) [semtic-label],
|
|
2823
2749
|
semtic-input-number:has([semtic-error]:not(:empty)) [semtic-label],
|
|
2824
2750
|
semtic-select:has([semtic-error]:not(:empty)) [semtic-label],
|
|
2825
|
-
semtic-textarea:has([semtic-error]:not(:empty)) [semtic-label]
|
|
2751
|
+
semtic-textarea:has([semtic-error]:not(:empty)) [semtic-label],
|
|
2752
|
+
semtic-input:has([wc-control]:user-invalid) [semtic-label],
|
|
2753
|
+
semtic-input-number:has([wc-control]:user-invalid) [semtic-label],
|
|
2754
|
+
semtic-select:has([wc-control]:user-invalid) [semtic-label],
|
|
2755
|
+
semtic-textarea:has([wc-control]:user-invalid) [semtic-label] {
|
|
2826
2756
|
color: var(--skirbi-error-base, #b91c1c);
|
|
2827
2757
|
}
|
|
2828
2758
|
|
|
@@ -3397,11 +3327,31 @@
|
|
|
3397
3327
|
margin-block-start: 0.25rem;
|
|
3398
3328
|
}
|
|
3399
3329
|
|
|
3330
|
+
/* Two ways a field reads as wrong, drawn the same: a message in
|
|
3331
|
+
* [semtic-error], and the browser's own constraint validation failing on
|
|
3332
|
+
* pattern, required, type, min/max and friends.
|
|
3333
|
+
*
|
|
3334
|
+
* :user-invalid, not :invalid. The browser holds it back until the field
|
|
3335
|
+
* has been left or a submit has been attempted, so a value that is merely
|
|
3336
|
+
* half-typed is not marked wrong on the second keystroke. :invalid would
|
|
3337
|
+
* light up a required field before it has ever been filled in.
|
|
3338
|
+
*
|
|
3339
|
+
* The colours are shared, the space is not: only a real message earns the
|
|
3340
|
+
* host its wash and padding further up, because that is what
|
|
3341
|
+
* label-error-position has to lay out and what changes the size of the
|
|
3342
|
+
* field. A native invalid state has no message to place, so it stays
|
|
3343
|
+
* within the box it already has and nothing moves as the user tabs out. */
|
|
3400
3344
|
semtic-input:has([semtic-error]:not(:empty)) input[wc-control],
|
|
3401
3345
|
semtic-select:has([semtic-error]:not(:empty)) select[wc-control],
|
|
3402
3346
|
semtic-textarea:has([semtic-error]:not(:empty)) textarea[wc-control],
|
|
3403
3347
|
semtic-checkbox:has([semtic-error]:not(:empty)) input[wc-control],
|
|
3404
|
-
semtic-radio:has([semtic-error]:not(:empty)) input[wc-control]
|
|
3348
|
+
semtic-radio:has([semtic-error]:not(:empty)) input[wc-control],
|
|
3349
|
+
semtic-input input[wc-control]:user-invalid,
|
|
3350
|
+
semtic-input-number input[wc-control]:user-invalid,
|
|
3351
|
+
semtic-select select[wc-control]:user-invalid,
|
|
3352
|
+
semtic-textarea textarea[wc-control]:user-invalid,
|
|
3353
|
+
semtic-checkbox input[wc-control]:user-invalid,
|
|
3354
|
+
semtic-radio input[wc-control]:user-invalid {
|
|
3405
3355
|
border-color: var(--skirbi-error-base, #b91c1c);
|
|
3406
3356
|
box-shadow: 0 0 0 3px color-mix(
|
|
3407
3357
|
in srgb, var(--skirbi-error-base, #b91c1c) 20%, transparent
|
package/package.json
CHANGED