@usableapp/cardds 0.7.177 → 0.7.178
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 +14 -0
- package/css/layover.css +68 -0
- package/css/lists.css +12 -0
- package/css/palette.css +7 -0
- package/css/parts.css +11 -0
- package/css/tokens.css +5 -1
- package/dist/cardds.css +103 -1
- package/dist/cards/inkGrounds.js +1 -1
- package/dist/catalog.json +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/layover/Popup.d.ts +23 -0
- package/dist/layover/Popup.js +15 -0
- package/dist/lists/Row.d.ts +10 -4
- package/dist/lists/Row.js +7 -6
- package/dist/parts/Lead.d.ts +7 -1
- package/dist/parts/Lead.js +3 -2
- package/docs/reference.md +19 -0
- package/lib/catalog.mjs +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,20 @@
|
|
|
6
6
|
|
|
7
7
|
## ยังไม่ปล่อย
|
|
8
8
|
|
|
9
|
+
## 0.7.178 — 2026-11-17
|
|
10
|
+
|
|
11
|
+
`Popup` (a panel under a button) is new, a `Row` can be `unread`, `Rows` can be `joined`, and a `Lead` takes a `tone`.
|
|
12
|
+
|
|
13
|
+
Components: all
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
- **`Popup`, `Row unread`, `Rows joined`, `Lead tone`** (cardds#219): before, a list read from a bell (notifications) could not be built from cardds: a `Menu popover` takes only `MenuItem`s (no head, no `Rows`, no scrolling head), a `Row` had no unread fill, `Rows` drew a gap and a hairline only BETWEEN rows, and a `Lead` was an outline in one colour. After, all four are opt-in and every existing screen is unchanged:
|
|
17
|
+
- `<Popup id="inbox" end title meta action={<Btn size="sm">…</Btn>}>` is a native popover panel under the button carrying `popoverTarget="inbox"` (tap outside or Esc closes): a head (title, a second line, ONE Btn at the right, sticky) over its children, flush to its left and right edges (`Rows joined`). `end` (a button at the screen's right) makes its right edge the button's and it grows leftwards; it is never wider than the room it has less `--popup-margin` each side, at most `--popup-w`, and scrolls inside itself when the room under the button is short (`--popup-max-h`). Knobs `--popup-margin`, `--popup-w`, `--popup-max-h`, `--popup-bg`, `--popup-border`, `--popup-radius`, `--popup-shadow`, `--popup-pad-x`, `--popup-pad-y`, `--popup-head-gap`.
|
|
18
|
+
- `<Row unread>`: a very light grey fill over the whole row, the new token `--unread-bg` (4% of the ink over any ground; knob `--row-unread-bg`); a screen reader hears "unread" (`unreadLabel`).
|
|
19
|
+
- `<Rows joined>`: no gap, every row a band edge to edge with its own padding and a border under it, so rows with a fill join. Knobs `--rows-joined-pad-x`, `--rows-joined-pad-y`, `--rows-joined-border`.
|
|
20
|
+
- `<Lead icon tone="blue|green|amber|red|pink|violet">`: a filled box, a white icon on a colour of cardds's set (new tokens `--tone-blue` … `--tone-violet`; in the wireframe six greys). The icon holds 4.5:1 or more in every shipped palette (lowest 4.74, blue on clay). Knobs `--lead-bg`, `--lead-ink`.
|
|
21
|
+
Stories `Popup · UnderABell`, `Popup · AtTheStart`, `Popup · LongList`, `Lead · Tones`, `Row · Unread`; the Palette page lists the tones and `--unread-bg`.
|
|
22
|
+
|
|
9
23
|
## 0.7.177 — 2026-11-17
|
|
10
24
|
|
|
11
25
|
`AppBar` holds two buttons and a round `Btn` shows a count, `Chip` takes a signal `tone`, `Head variant="date"` takes two chip rows, `NoteRows` and `Was` (a struck-through old value) are new, and a `Modal` mounted closed draws nothing.
|
package/css/layover.css
CHANGED
|
@@ -163,6 +163,74 @@
|
|
|
163
163
|
@starting-style { .menu:popover-open { opacity: 0; translate: 0 calc(-1 * var(--sp-2)); } }
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
+
/* ---- popup: a panel hung under the button that opens it — a head and `Rows joined` flush to its edges (cardds#219) ----
|
|
167
|
+
<button class="btn" popovertarget="inbox">…</button>
|
|
168
|
+
<div class="popup popup--end" id="inbox" popover role="group"><div class="popup__head"><span class="words">…</span><button class="btn">Read all</button></div>
|
|
169
|
+
<div class="rows rows--joined"><a class="row">…</a>…</div></div>
|
|
170
|
+
Native popover, as .menu: light dismiss, Esc, top layer, anchored to its invoker where anchor positioning exists. It is a paper of its own (the card-1 ground, so
|
|
171
|
+
the words on it follow that side), never wider than the screen less a margin each side, and scrolls inside itself when the room under the button is short: the head
|
|
172
|
+
is sticky, opaque, so a row's fill passes under it. Without anchor positioning (iOS before 26) it hangs under the top bar: the margin from the screen's start edge,
|
|
173
|
+
or from its end edge (a margin in) with .popup--end. .popup--end = the button is at the screen's right: the popup's right edge is the button's, it grows leftwards (as .menu--end), its left margin kept by max-width. */
|
|
174
|
+
.popup {
|
|
175
|
+
--card-bg: var(--card-1-bg); /* the paper's own slot (a ring, a fold reads it); its side, the inks follow (tokens.css) */
|
|
176
|
+
--dark: var(--card-1-dark);
|
|
177
|
+
--_popup-w: calc(var(--tap-base) * 8); /* 384: the widest it grows */
|
|
178
|
+
--_popup-max-h: calc(var(--tap-base) * 12); /* 576: the tallest it grows, short screens aside */
|
|
179
|
+
--_popup-room: calc(100dvh - var(--safe-top) - var(--header-h) - var(--sp-2) - var(--popup-margin, var(--sp-3))); /* the room under the top bar; anchored, what is under the button (below) */
|
|
180
|
+
display: none; /* explicit closed state — never display on the base rule */
|
|
181
|
+
margin: 0;
|
|
182
|
+
padding: 0;
|
|
183
|
+
inset: auto;
|
|
184
|
+
inset-block-start: calc(var(--safe-top) + var(--header-h) + var(--sp-2));
|
|
185
|
+
inset-inline-start: var(--popup-margin, var(--sp-3));
|
|
186
|
+
width: var(--popup-w, var(--_popup-w));
|
|
187
|
+
max-width: calc(100% - 2 * var(--popup-margin, var(--sp-3)));
|
|
188
|
+
max-height: min(var(--popup-max-h, var(--_popup-max-h)), var(--_popup-room));
|
|
189
|
+
overflow-y: auto;
|
|
190
|
+
overscroll-behavior: contain;
|
|
191
|
+
background: var(--popup-bg, var(--card-bg));
|
|
192
|
+
color: var(--card-ink);
|
|
193
|
+
border: var(--border-w) solid var(--popup-border, var(--card-border));
|
|
194
|
+
border-radius: var(--popup-radius, var(--r-card));
|
|
195
|
+
box-shadow: var(--popup-shadow, var(--shadow-float));
|
|
196
|
+
}
|
|
197
|
+
.popup:popover-open { display: block; }
|
|
198
|
+
.popup.\:popover-open { display: block; } /* the polyfill's open (iOS 16.4), its own rule as .menu's */
|
|
199
|
+
.popup--end { inset-inline-start: auto; inset-inline-end: var(--popup-margin, var(--sp-3)); }
|
|
200
|
+
.popup__head {
|
|
201
|
+
position: sticky;
|
|
202
|
+
inset-block-start: 0;
|
|
203
|
+
z-index: var(--z-over);
|
|
204
|
+
display: flex;
|
|
205
|
+
align-items: center;
|
|
206
|
+
gap: var(--popup-head-gap, var(--sp-3));
|
|
207
|
+
padding: var(--popup-pad-y, var(--sp-3)) var(--popup-pad-x, var(--sp-4));
|
|
208
|
+
background: var(--popup-bg, var(--card-bg)); /* opaque: what scrolls under it is hidden, a row's fill too */
|
|
209
|
+
border-bottom: var(--border-w) solid var(--hairline);
|
|
210
|
+
}
|
|
211
|
+
.popup__head > .words { flex: 1; min-width: 0; }
|
|
212
|
+
.popup__head > :not(.words) { flex: none; }
|
|
213
|
+
@supports (anchor-name: --a) {
|
|
214
|
+
.popup[popover] {
|
|
215
|
+
position-area: block-end span-inline-end; /* from the button's start edge, rightwards */
|
|
216
|
+
inset: auto;
|
|
217
|
+
margin-block: var(--sp-2) var(--popup-margin, var(--sp-3));
|
|
218
|
+
--_popup-room: calc(100% - var(--sp-2) - var(--popup-margin, var(--sp-3))); /* % of the area under the button */
|
|
219
|
+
position-try-fallbacks: flip-block;
|
|
220
|
+
}
|
|
221
|
+
.popup--end[popover] { position-area: block-end span-inline-start; } /* the button's right edge, leftwards (as .menu--end): the bar's own inset is the margin */
|
|
222
|
+
}
|
|
223
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
224
|
+
.popup[popover] {
|
|
225
|
+
opacity: 0;
|
|
226
|
+
translate: 0 calc(-1 * var(--sp-2));
|
|
227
|
+
transition: display var(--motion-quick) allow-discrete, overlay var(--motion-quick) allow-discrete, opacity var(--motion-quick), translate var(--motion-quick);
|
|
228
|
+
}
|
|
229
|
+
.popup:popover-open { opacity: 1; translate: 0 0; }
|
|
230
|
+
.popup.\:popover-open { opacity: 1; translate: 0 0; }
|
|
231
|
+
@starting-style { .popup:popover-open { opacity: 0; translate: 0 calc(-1 * var(--sp-2)); } }
|
|
232
|
+
}
|
|
233
|
+
|
|
166
234
|
/* ---- banner: ONE band — the line that opens it and the body share one ground (Lh 2026-09-24: "ปุ่มกับเนื้อหาใช้พื้นที่เดียวกัน") ----
|
|
167
235
|
<details class="banner"><summary class="banner__summary">Save 2 h… <svg class="icon icon--xs"/></summary>
|
|
168
236
|
<div class="banner__body">…</div></details>
|
package/css/lists.css
CHANGED
|
@@ -63,6 +63,18 @@
|
|
|
63
63
|
border-top: var(--border-w) solid var(--hairline);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
/* a row not yet seen (`Row unread`, cardds#219): the whole row takes a very light grey fill, the token --unread-bg (4% of the ink over any ground) */
|
|
67
|
+
.row--unread { background: var(--row-unread-bg, var(--unread-bg)); }
|
|
68
|
+
|
|
69
|
+
/* joined rows (`Rows joined`, cardds#219): no gap, every row a band edge to edge with its padding and a border under it (the last too), so a row with a fill
|
|
70
|
+
touches the next and reads as a band. The between-rows hairline is not drawn (the border is the line); a list for a holder that fills its width (a Popup) */
|
|
71
|
+
.rows.rows--joined { --rows-gap: 0rem; }
|
|
72
|
+
.rows--joined > .row + .row::before { display: none; }
|
|
73
|
+
.rows--joined > :is(.row, .row-expand) { border-bottom: var(--border-w) solid var(--rows-joined-border, var(--hairline)); }
|
|
74
|
+
.rows--joined > .row, .rows--joined > .row-expand > summary { padding: var(--rows-joined-pad-y, var(--sp-3)) var(--rows-joined-pad-x, var(--sp-4)); }
|
|
75
|
+
.rows--joined > .row-expand > .row-expand__more { padding: 0 var(--rows-joined-pad-x, var(--sp-4)) var(--rows-joined-pad-y, var(--sp-3)); }
|
|
76
|
+
.rows--joined > .rows__head { padding: var(--rows-joined-pad-y, var(--sp-3)) var(--rows-joined-pad-x, var(--sp-4)) 0; }
|
|
77
|
+
|
|
66
78
|
/* ---- kv: label left, value right ----
|
|
67
79
|
<dl class="kv"><div class="kv__row"><dt class="kv__key">Pay with</dt><dd class="kv__val">GHO</dd></div>…</dl> */
|
|
68
80
|
.kv { margin: 0; display: grid; }
|
package/css/palette.css
CHANGED
|
@@ -123,6 +123,13 @@
|
|
|
123
123
|
--dot-a: #dd9787; --dot-b: #b08a5a;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
/* TONES (cardds#219): the six fills of a `Lead tone`, a white icon on a colour to tell kinds of thing apart — in coloured mode, whatever the palette (a project's own
|
|
127
|
+
`data-palette` too). Each holds the ondark ink at 4.5:1 or more on every palette cardds ships, the dimmest ink (clay's #f4efe4) included; the lowest is blue on clay, 4.74.
|
|
128
|
+
A project whose own ondark ink is dimmer than that retunes the tone it fails (inkGrounds() names it), or sets it in its theme.css. The wireframe's are greys (tokens.css) */
|
|
129
|
+
[data-palette] {
|
|
130
|
+
--tone-blue: #2a6f9e; --tone-green: #52613d; --tone-amber: #8a5a12; --tone-red: #c22d12; --tone-pink: #b8285e; --tone-violet: #5b4a8a;
|
|
131
|
+
}
|
|
132
|
+
|
|
126
133
|
/* Colored palettes trade wireframe outlines for soft elevation. */
|
|
127
134
|
[data-palette] :is(.card, .band-stack) { box-shadow: var(--shadow-card); }
|
|
128
135
|
/* COLOURED MODE is the attribute, whatever its value: a project with colours of its own (the five
|
package/css/parts.css
CHANGED
|
@@ -26,6 +26,17 @@
|
|
|
26
26
|
}
|
|
27
27
|
.feed-card > .head:has(> .t-caption) > .lead { grid-row: span 2; }
|
|
28
28
|
|
|
29
|
+
/* a filled lead (`Lead tone`, cardds#219): one colour of the set (tokens.css greys, palette.css colours), no outline (its border colour is clear, in a row card too), the ondark ink on it. It declares its side (dark)
|
|
30
|
+
so inkGrounds() reads it as a dark ground, and names the ink itself: its ground is its own fill, not the card's */
|
|
31
|
+
.lead--tone, :is(.card--row, .feed-card > .head) > .lead--tone { border-color: transparent; }
|
|
32
|
+
.lead--tone { --dark: 1; background: var(--lead-bg, var(--_lead-fill)); color: var(--lead-ink, var(--ink-ondark)); }
|
|
33
|
+
.lead--blue { --_lead-fill: var(--tone-blue); }
|
|
34
|
+
.lead--green { --_lead-fill: var(--tone-green); }
|
|
35
|
+
.lead--amber { --_lead-fill: var(--tone-amber); }
|
|
36
|
+
.lead--red { --_lead-fill: var(--tone-red); }
|
|
37
|
+
.lead--pink { --_lead-fill: var(--tone-pink); }
|
|
38
|
+
.lead--violet { --_lead-fill: var(--tone-violet); }
|
|
39
|
+
|
|
29
40
|
/* ---- words: the title over its meta, taking the room between the lead and the end ---- */
|
|
30
41
|
.words { flex: 1; display: grid; gap: var(--words-gap, var(--sp-0)); }
|
|
31
42
|
.row > .words { min-width: 0; }
|
package/css/tokens.css
CHANGED
|
@@ -334,6 +334,9 @@
|
|
|
334
334
|
--signal-info-onlight: #2e5c98;
|
|
335
335
|
/* highlights (Lh 2026-09-25): four atmosphere colours a palette may set for decoration — a count, a mark, a chart dot; the wireframe keeps them grey */
|
|
336
336
|
--highlight-1: #3d3d3d; --highlight-2: #8a8a8a; --highlight-3: #5f5f5f; --highlight-4: #b0b0b0;
|
|
337
|
+
/* tones (cardds#219): six fills for a small box that carries the ondark ink (a `Lead tone`), to tell kinds of thing apart. Colour lives in palette.css only, so the
|
|
338
|
+
wireframe keeps six greys — darkened so white holds 4.5:1 on each (a project's theme may set them) */
|
|
339
|
+
--tone-blue: #111111; --tone-green: #2b2b2b; --tone-amber: #444444; --tone-red: #595959; --tone-pink: #666666; --tone-violet: #737373;
|
|
337
340
|
--signal-error-onlight: #af2525; /* something went wrong — a field's edge, the words that say what */
|
|
338
341
|
/* on a dark ground no shade of one hue holds 4.5:1 on every palette's dark fill and stays itself: a signal there is the ondark ink,
|
|
339
342
|
and the icon and the words carry the meaning. A palette may give its own (orchard) */
|
|
@@ -343,6 +346,7 @@
|
|
|
343
346
|
--outline: var(--action-border); /* control edges (palette.css softens) */
|
|
344
347
|
--hairline: color-mix(in srgb, currentColor 18%, transparent); /* dividers inside cards */
|
|
345
348
|
--ink-tint: color-mix(in srgb, currentColor 12%, transparent); /* hover, rails, rests */
|
|
349
|
+
--unread-bg: color-mix(in srgb, currentColor 4%, transparent); /* a very light grey over any ground: a row never read (Row unread) */
|
|
346
350
|
--ink-rail: color-mix(in srgb, currentColor 30%, transparent); /* todo steps, ghost edges */
|
|
347
351
|
--accent-soft: color-mix(in srgb, var(--accent) 22%, transparent); /* calendar marks */
|
|
348
352
|
--accent-wash: color-mix(in srgb, var(--accent) 22%, var(--action-bg)); /* the same wash laid on the paper of fields and buttons, opaque: a soft chip reads the same on any card (Chip soft) */
|
|
@@ -413,7 +417,7 @@
|
|
|
413
417
|
tile) takes its ground's side: `--dark: inherit`. inkGrounds() measures it; docs/reference.md "Ink follows its ground" */
|
|
414
418
|
:where(body, [data-palette], [data-mode], .card, .tile, .modal__drawer, .postcard__front, .postcard__back, .sticky, .post-paper,
|
|
415
419
|
.float-bar__pill, .snackbar__body, .track, .tile-badge, .avatar, .bubble__body, .map__hint, .map__pin, .sheet--paper > :is(.body, .foot),
|
|
416
|
-
.postcard__band, .track__step, .toggle, .chip, .btn--warn, .card__face, .card--bands > :is(.head, .foot), .card--bands > .card__face > :is(.head, .foot)) {
|
|
420
|
+
.postcard__band, .track__step, .toggle, .chip, .btn--warn, .card__face, .card--bands > :is(.head, .foot), .card--bands > .card__face > :is(.head, .foot), .popup) {
|
|
417
421
|
--card-ink: color-mix(in srgb, var(--ink-ondark) calc(var(--dark) * 100%), var(--ink-onlight));
|
|
418
422
|
--card-muted: color-mix(in srgb, var(--ink-ondark-muted) calc(var(--dark) * 100%), var(--ink-onlight-muted));
|
|
419
423
|
--on-accent: color-mix(in srgb, var(--ink-ondark) calc(var(--accent-dark) * 100%), var(--ink-onlight));
|
package/dist/cardds.css
CHANGED
|
@@ -404,6 +404,9 @@
|
|
|
404
404
|
--signal-info-onlight: #2e5c98;
|
|
405
405
|
/* highlights (Lh 2026-09-25): four atmosphere colours a palette may set for decoration — a count, a mark, a chart dot; the wireframe keeps them grey */
|
|
406
406
|
--highlight-1: #3d3d3d; --highlight-2: #8a8a8a; --highlight-3: #5f5f5f; --highlight-4: #b0b0b0;
|
|
407
|
+
/* tones (cardds#219): six fills for a small box that carries the ondark ink (a `Lead tone`), to tell kinds of thing apart. Colour lives in palette.css only, so the
|
|
408
|
+
wireframe keeps six greys — darkened so white holds 4.5:1 on each (a project's theme may set them) */
|
|
409
|
+
--tone-blue: #111111; --tone-green: #2b2b2b; --tone-amber: #444444; --tone-red: #595959; --tone-pink: #666666; --tone-violet: #737373;
|
|
407
410
|
--signal-error-onlight: #af2525; /* something went wrong — a field's edge, the words that say what */
|
|
408
411
|
/* on a dark ground no shade of one hue holds 4.5:1 on every palette's dark fill and stays itself: a signal there is the ondark ink,
|
|
409
412
|
and the icon and the words carry the meaning. A palette may give its own (orchard) */
|
|
@@ -413,6 +416,7 @@
|
|
|
413
416
|
--outline: var(--action-border); /* control edges (palette.css softens) */
|
|
414
417
|
--hairline: color-mix(in srgb, currentColor 18%, transparent); /* dividers inside cards */
|
|
415
418
|
--ink-tint: color-mix(in srgb, currentColor 12%, transparent); /* hover, rails, rests */
|
|
419
|
+
--unread-bg: color-mix(in srgb, currentColor 4%, transparent); /* a very light grey over any ground: a row never read (Row unread) */
|
|
416
420
|
--ink-rail: color-mix(in srgb, currentColor 30%, transparent); /* todo steps, ghost edges */
|
|
417
421
|
--accent-soft: color-mix(in srgb, var(--accent) 22%, transparent); /* calendar marks */
|
|
418
422
|
--accent-wash: color-mix(in srgb, var(--accent) 22%, var(--action-bg)); /* the same wash laid on the paper of fields and buttons, opaque: a soft chip reads the same on any card (Chip soft) */
|
|
@@ -483,7 +487,7 @@
|
|
|
483
487
|
tile) takes its ground's side: `--dark: inherit`. inkGrounds() measures it; docs/reference.md "Ink follows its ground" */
|
|
484
488
|
:where(body, [data-palette], [data-mode], .card, .tile, .modal__drawer, .postcard__front, .postcard__back, .sticky, .post-paper,
|
|
485
489
|
.float-bar__pill, .snackbar__body, .track, .tile-badge, .avatar, .bubble__body, .map__hint, .map__pin, .sheet--paper > :is(.body, .foot),
|
|
486
|
-
.postcard__band, .track__step, .toggle, .chip, .btn--warn, .card__face, .card--bands > :is(.head, .foot), .card--bands > .card__face > :is(.head, .foot)) {
|
|
490
|
+
.postcard__band, .track__step, .toggle, .chip, .btn--warn, .card__face, .card--bands > :is(.head, .foot), .card--bands > .card__face > :is(.head, .foot), .popup) {
|
|
487
491
|
--card-ink: color-mix(in srgb, var(--ink-ondark) calc(var(--dark) * 100%), var(--ink-onlight));
|
|
488
492
|
--card-muted: color-mix(in srgb, var(--ink-ondark-muted) calc(var(--dark) * 100%), var(--ink-onlight-muted));
|
|
489
493
|
--on-accent: color-mix(in srgb, var(--ink-ondark) calc(var(--accent-dark) * 100%), var(--ink-onlight));
|
|
@@ -636,6 +640,13 @@
|
|
|
636
640
|
--dot-a: #dd9787; --dot-b: #b08a5a;
|
|
637
641
|
}
|
|
638
642
|
|
|
643
|
+
/* TONES (cardds#219): the six fills of a `Lead tone`, a white icon on a colour to tell kinds of thing apart — in coloured mode, whatever the palette (a project's own
|
|
644
|
+
`data-palette` too). Each holds the ondark ink at 4.5:1 or more on every palette cardds ships, the dimmest ink (clay's #f4efe4) included; the lowest is blue on clay, 4.74.
|
|
645
|
+
A project whose own ondark ink is dimmer than that retunes the tone it fails (inkGrounds() names it), or sets it in its theme.css. The wireframe's are greys (tokens.css) */
|
|
646
|
+
[data-palette] {
|
|
647
|
+
--tone-blue: #2a6f9e; --tone-green: #52613d; --tone-amber: #8a5a12; --tone-red: #c22d12; --tone-pink: #b8285e; --tone-violet: #5b4a8a;
|
|
648
|
+
}
|
|
649
|
+
|
|
639
650
|
/* Colored palettes trade wireframe outlines for soft elevation. */
|
|
640
651
|
[data-palette] :is(.card, .band-stack) { box-shadow: var(--shadow-card); }
|
|
641
652
|
/* COLOURED MODE is the attribute, whatever its value: a project with colours of its own (the five
|
|
@@ -4459,6 +4470,18 @@ button.calendar__label:focus-visible { outline: var(--focus); outline-offset: va
|
|
|
4459
4470
|
border-top: var(--border-w) solid var(--hairline);
|
|
4460
4471
|
}
|
|
4461
4472
|
|
|
4473
|
+
/* a row not yet seen (`Row unread`, cardds#219): the whole row takes a very light grey fill, the token --unread-bg (4% of the ink over any ground) */
|
|
4474
|
+
.row--unread { background: var(--row-unread-bg, var(--unread-bg)); }
|
|
4475
|
+
|
|
4476
|
+
/* joined rows (`Rows joined`, cardds#219): no gap, every row a band edge to edge with its padding and a border under it (the last too), so a row with a fill
|
|
4477
|
+
touches the next and reads as a band. The between-rows hairline is not drawn (the border is the line); a list for a holder that fills its width (a Popup) */
|
|
4478
|
+
.rows.rows--joined { --rows-gap: 0rem; }
|
|
4479
|
+
.rows--joined > .row + .row::before { display: none; }
|
|
4480
|
+
.rows--joined > :is(.row, .row-expand) { border-bottom: var(--border-w) solid var(--rows-joined-border, var(--hairline)); }
|
|
4481
|
+
.rows--joined > .row, .rows--joined > .row-expand > summary { padding: var(--rows-joined-pad-y, var(--sp-3)) var(--rows-joined-pad-x, var(--sp-4)); }
|
|
4482
|
+
.rows--joined > .row-expand > .row-expand__more { padding: 0 var(--rows-joined-pad-x, var(--sp-4)) var(--rows-joined-pad-y, var(--sp-3)); }
|
|
4483
|
+
.rows--joined > .rows__head { padding: var(--rows-joined-pad-y, var(--sp-3)) var(--rows-joined-pad-x, var(--sp-4)) 0; }
|
|
4484
|
+
|
|
4462
4485
|
/* ---- kv: label left, value right ----
|
|
4463
4486
|
<dl class="kv"><div class="kv__row"><dt class="kv__key">Pay with</dt><dd class="kv__val">GHO</dd></div>…</dl> */
|
|
4464
4487
|
.kv { margin: 0; display: grid; }
|
|
@@ -4649,6 +4672,17 @@ a.bubble { color: inherit; text-decoration: none; }
|
|
|
4649
4672
|
}
|
|
4650
4673
|
.feed-card > .head:has(> .t-caption) > .lead { grid-row: span 2; }
|
|
4651
4674
|
|
|
4675
|
+
/* a filled lead (`Lead tone`, cardds#219): one colour of the set (tokens.css greys, palette.css colours), no outline (its border colour is clear, in a row card too), the ondark ink on it. It declares its side (dark)
|
|
4676
|
+
so inkGrounds() reads it as a dark ground, and names the ink itself: its ground is its own fill, not the card's */
|
|
4677
|
+
.lead--tone, :is(.card--row, .feed-card > .head) > .lead--tone { border-color: transparent; }
|
|
4678
|
+
.lead--tone { --dark: 1; background: var(--lead-bg, var(--_lead-fill)); color: var(--lead-ink, var(--ink-ondark)); }
|
|
4679
|
+
.lead--blue { --_lead-fill: var(--tone-blue); }
|
|
4680
|
+
.lead--green { --_lead-fill: var(--tone-green); }
|
|
4681
|
+
.lead--amber { --_lead-fill: var(--tone-amber); }
|
|
4682
|
+
.lead--red { --_lead-fill: var(--tone-red); }
|
|
4683
|
+
.lead--pink { --_lead-fill: var(--tone-pink); }
|
|
4684
|
+
.lead--violet { --_lead-fill: var(--tone-violet); }
|
|
4685
|
+
|
|
4652
4686
|
/* ---- words: the title over its meta, taking the room between the lead and the end ---- */
|
|
4653
4687
|
.words { flex: 1; display: grid; gap: var(--words-gap, var(--sp-0)); }
|
|
4654
4688
|
.row > .words { min-width: 0; }
|
|
@@ -6772,6 +6806,74 @@ a.bubble { color: inherit; text-decoration: none; }
|
|
|
6772
6806
|
@starting-style { .menu:popover-open { opacity: 0; translate: 0 calc(-1 * var(--sp-2)); } }
|
|
6773
6807
|
}
|
|
6774
6808
|
|
|
6809
|
+
/* ---- popup: a panel hung under the button that opens it — a head and `Rows joined` flush to its edges (cardds#219) ----
|
|
6810
|
+
<button class="btn" popovertarget="inbox">…</button>
|
|
6811
|
+
<div class="popup popup--end" id="inbox" popover role="group"><div class="popup__head"><span class="words">…</span><button class="btn">Read all</button></div>
|
|
6812
|
+
<div class="rows rows--joined"><a class="row">…</a>…</div></div>
|
|
6813
|
+
Native popover, as .menu: light dismiss, Esc, top layer, anchored to its invoker where anchor positioning exists. It is a paper of its own (the card-1 ground, so
|
|
6814
|
+
the words on it follow that side), never wider than the screen less a margin each side, and scrolls inside itself when the room under the button is short: the head
|
|
6815
|
+
is sticky, opaque, so a row's fill passes under it. Without anchor positioning (iOS before 26) it hangs under the top bar: the margin from the screen's start edge,
|
|
6816
|
+
or from its end edge (a margin in) with .popup--end. .popup--end = the button is at the screen's right: the popup's right edge is the button's, it grows leftwards (as .menu--end), its left margin kept by max-width. */
|
|
6817
|
+
.popup {
|
|
6818
|
+
--card-bg: var(--card-1-bg); /* the paper's own slot (a ring, a fold reads it); its side, the inks follow (tokens.css) */
|
|
6819
|
+
--dark: var(--card-1-dark);
|
|
6820
|
+
--_popup-w: calc(var(--tap-base) * 8); /* 384: the widest it grows */
|
|
6821
|
+
--_popup-max-h: calc(var(--tap-base) * 12); /* 576: the tallest it grows, short screens aside */
|
|
6822
|
+
--_popup-room: calc(100dvh - var(--safe-top) - var(--header-h) - var(--sp-2) - var(--popup-margin, var(--sp-3))); /* the room under the top bar; anchored, what is under the button (below) */
|
|
6823
|
+
display: none; /* explicit closed state — never display on the base rule */
|
|
6824
|
+
margin: 0;
|
|
6825
|
+
padding: 0;
|
|
6826
|
+
inset: auto;
|
|
6827
|
+
inset-block-start: calc(var(--safe-top) + var(--header-h) + var(--sp-2));
|
|
6828
|
+
inset-inline-start: var(--popup-margin, var(--sp-3));
|
|
6829
|
+
width: var(--popup-w, var(--_popup-w));
|
|
6830
|
+
max-width: calc(100% - 2 * var(--popup-margin, var(--sp-3)));
|
|
6831
|
+
max-height: min(var(--popup-max-h, var(--_popup-max-h)), var(--_popup-room));
|
|
6832
|
+
overflow-y: auto;
|
|
6833
|
+
overscroll-behavior: contain;
|
|
6834
|
+
background: var(--popup-bg, var(--card-bg));
|
|
6835
|
+
color: var(--card-ink);
|
|
6836
|
+
border: var(--border-w) solid var(--popup-border, var(--card-border));
|
|
6837
|
+
border-radius: var(--popup-radius, var(--r-card));
|
|
6838
|
+
box-shadow: var(--popup-shadow, var(--shadow-float));
|
|
6839
|
+
}
|
|
6840
|
+
.popup:popover-open { display: block; }
|
|
6841
|
+
.popup.\:popover-open { display: block; } /* the polyfill's open (iOS 16.4), its own rule as .menu's */
|
|
6842
|
+
.popup--end { inset-inline-start: auto; inset-inline-end: var(--popup-margin, var(--sp-3)); }
|
|
6843
|
+
.popup__head {
|
|
6844
|
+
position: sticky;
|
|
6845
|
+
inset-block-start: 0;
|
|
6846
|
+
z-index: var(--z-over);
|
|
6847
|
+
display: flex;
|
|
6848
|
+
align-items: center;
|
|
6849
|
+
gap: var(--popup-head-gap, var(--sp-3));
|
|
6850
|
+
padding: var(--popup-pad-y, var(--sp-3)) var(--popup-pad-x, var(--sp-4));
|
|
6851
|
+
background: var(--popup-bg, var(--card-bg)); /* opaque: what scrolls under it is hidden, a row's fill too */
|
|
6852
|
+
border-bottom: var(--border-w) solid var(--hairline);
|
|
6853
|
+
}
|
|
6854
|
+
.popup__head > .words { flex: 1; min-width: 0; }
|
|
6855
|
+
.popup__head > :not(.words) { flex: none; }
|
|
6856
|
+
@supports (anchor-name: --a) {
|
|
6857
|
+
.popup[popover] {
|
|
6858
|
+
position-area: block-end span-inline-end; /* from the button's start edge, rightwards */
|
|
6859
|
+
inset: auto;
|
|
6860
|
+
margin-block: var(--sp-2) var(--popup-margin, var(--sp-3));
|
|
6861
|
+
--_popup-room: calc(100% - var(--sp-2) - var(--popup-margin, var(--sp-3))); /* % of the area under the button */
|
|
6862
|
+
position-try-fallbacks: flip-block;
|
|
6863
|
+
}
|
|
6864
|
+
.popup--end[popover] { position-area: block-end span-inline-start; } /* the button's right edge, leftwards (as .menu--end): the bar's own inset is the margin */
|
|
6865
|
+
}
|
|
6866
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
6867
|
+
.popup[popover] {
|
|
6868
|
+
opacity: 0;
|
|
6869
|
+
translate: 0 calc(-1 * var(--sp-2));
|
|
6870
|
+
transition: display var(--motion-quick) allow-discrete, overlay var(--motion-quick) allow-discrete, opacity var(--motion-quick), translate var(--motion-quick);
|
|
6871
|
+
}
|
|
6872
|
+
.popup:popover-open { opacity: 1; translate: 0 0; }
|
|
6873
|
+
.popup.\:popover-open { opacity: 1; translate: 0 0; }
|
|
6874
|
+
@starting-style { .popup:popover-open { opacity: 0; translate: 0 calc(-1 * var(--sp-2)); } }
|
|
6875
|
+
}
|
|
6876
|
+
|
|
6775
6877
|
/* ---- banner: ONE band — the line that opens it and the body share one ground (Lh 2026-09-24: "ปุ่มกับเนื้อหาใช้พื้นที่เดียวกัน") ----
|
|
6776
6878
|
<details class="banner"><summary class="banner__summary">Save 2 h… <svg class="icon icon--xs"/></summary>
|
|
6777
6879
|
<div class="banner__body">…</div></details>
|
package/dist/cards/inkGrounds.js
CHANGED
|
@@ -75,7 +75,7 @@ export function inkGrounds(root = document.body) {
|
|
|
75
75
|
const SETS = ['--ink-onlight', '--ink-onlight-muted', '--ink-ondark', '--ink-ondark-muted', ...['ok', 'warn', 'error', 'info'].flatMap((s) => [`--signal-${s}-onlight`, `--signal-${s}-ondark`])];
|
|
76
76
|
const INKS = ['--card-ink', '--card-muted', '--on-accent', '--accent-ink', '--accent', '--action-ink', '--action-muted', '--action-accent', '--on-surface', '--on-surface-muted',
|
|
77
77
|
'--signal-ok', '--signal-warn', '--signal-error', '--signal-info'];
|
|
78
|
-
const GROUNDS = ['--card-bg', '--accent', '--action-bg', '--surface', '--neg', '--pos', ...[1, 2, 3, 4, 5].map((t) => `--card-${t}-bg`), '--highlight-1', '--highlight-2', '--highlight-3', '--highlight-4'];
|
|
78
|
+
const GROUNDS = ['--card-bg', '--accent', '--action-bg', '--surface', '--neg', '--pos', ...[1, 2, 3, 4, 5].map((t) => `--card-${t}-bg`), '--highlight-1', '--highlight-2', '--highlight-3', '--highlight-4', ...['blue', 'green', 'amber', 'red', 'pink', 'violet'].map((t) => `--tone-${t}`)];
|
|
79
79
|
const tokenOf = (el, colour, names) => {
|
|
80
80
|
const want = rgba(colour).join();
|
|
81
81
|
return names.find((n) => { const v = style(el).getPropertyValue(n).trim(); return v !== '' && rgba(v).join() === want; }) ?? '';
|