@plus234feed/ds 0.13.0 → 0.15.0
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/package.json +1 -1
- package/src/components.css +85 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plus234feed/ds",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Plus234Feed design system. Editorial tokens, type scale and components for a news intelligence platform: newspaper hierarchy, accessible colour in both themes, one component per job.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"design-system",
|
package/src/components.css
CHANGED
|
@@ -331,21 +331,86 @@
|
|
|
331
331
|
`min(100%, ...)` is what keeps a single column on a phone: without it the
|
|
332
332
|
minimum wins and the row overflows the screen. */
|
|
333
333
|
.p234-tiles {
|
|
334
|
-
display:
|
|
334
|
+
display: flex;
|
|
335
|
+
flex-wrap: wrap;
|
|
335
336
|
gap: var(--p234-space-6);
|
|
336
|
-
|
|
337
|
+
/* The row decides its columns from its own width, not the viewport's. The
|
|
338
|
+
version before this used a viewport media query with thresholds worked
|
|
339
|
+
out for the page measure, and the first page with a rail beside the
|
|
340
|
+
content got four tiles as three and one again. */
|
|
341
|
+
container-type: inline-size;
|
|
342
|
+
}
|
|
343
|
+
/* Flex rather than grid for one reason: when a count does not divide, the
|
|
344
|
+
tiles on the last row grow to fill it, so five never leaves a lone tile at
|
|
345
|
+
a third of the width. A grid leaves the hole. */
|
|
346
|
+
.p234-tiles > * { flex: 1 1 100%; min-width: 0; }
|
|
347
|
+
|
|
348
|
+
@container (min-width: 34rem) {
|
|
349
|
+
.p234-tiles > * { flex-basis: calc(50% - var(--p234-space-6)); }
|
|
350
|
+
.p234-tiles:has(> :nth-child(3):last-child) > * { flex-basis: calc(33.4% - var(--p234-space-6)); }
|
|
351
|
+
}
|
|
352
|
+
@container (min-width: 52rem) {
|
|
353
|
+
.p234-tiles:has(> :nth-child(4):last-child) > *,
|
|
354
|
+
.p234-tiles:has(> :nth-child(7):last-child) > *,
|
|
355
|
+
.p234-tiles:has(> :nth-child(8):last-child) > * { flex-basis: calc(25% - var(--p234-space-6)); }
|
|
356
|
+
.p234-tiles:has(> :nth-child(5):last-child) > *,
|
|
357
|
+
.p234-tiles:has(> :nth-child(6):last-child) > * { flex-basis: calc(33.4% - var(--p234-space-6)); }
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/* --- section head ------------------------------------------------------
|
|
361
|
+
A heading with a note on the same line and a rule beneath: "Global
|
|
362
|
+
commodities" with "Spot, USD" at the right, "Monthly movers" with the date
|
|
363
|
+
range. The markets page did this six times, each with its own icon in
|
|
364
|
+
front of the heading saying what the heading said. */
|
|
365
|
+
.p234-sectionhead {
|
|
366
|
+
display: flex;
|
|
367
|
+
align-items: baseline;
|
|
368
|
+
justify-content: space-between;
|
|
369
|
+
gap: var(--p234-space-4);
|
|
370
|
+
flex-wrap: wrap;
|
|
371
|
+
padding-bottom: var(--p234-space-3);
|
|
372
|
+
border-bottom: var(--p234-border-thick) solid var(--p234-color-ink);
|
|
373
|
+
margin-bottom: var(--p234-space-5);
|
|
374
|
+
}
|
|
375
|
+
.p234-sectionhead__title {
|
|
376
|
+
font-family: var(--p234-type-headline-sm-family);
|
|
377
|
+
font-size: var(--p234-type-headline-sm-size);
|
|
378
|
+
line-height: var(--p234-type-headline-sm-leading);
|
|
379
|
+
letter-spacing: var(--p234-type-headline-sm-tracking);
|
|
380
|
+
font-weight: var(--p234-type-headline-sm-weight);
|
|
381
|
+
color: var(--p234-color-ink);
|
|
382
|
+
margin: 0;
|
|
383
|
+
}
|
|
384
|
+
.p234-sectionhead__note {
|
|
385
|
+
font-family: var(--p234-type-meta-family);
|
|
386
|
+
font-size: var(--p234-type-meta-size);
|
|
387
|
+
color: var(--p234-color-ink-muted);
|
|
337
388
|
}
|
|
338
389
|
|
|
339
|
-
/*
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
.
|
|
344
|
-
|
|
390
|
+
/* --- sparkline ---------------------------------------------------------
|
|
391
|
+
A line of recent prices beside a figure, small enough to sit in a row.
|
|
392
|
+
The page draws the path; this sets its size and stroke, and takes the
|
|
393
|
+
colour from the delta tokens so a rise and a fall look the same here as
|
|
394
|
+
they do in the number beside it. It is a shape, not a chart: no axes, no
|
|
395
|
+
labels, and it never carries a value the row does not also state. */
|
|
396
|
+
.p234-sparkline {
|
|
397
|
+
display: inline-block;
|
|
398
|
+
width: 5rem;
|
|
399
|
+
height: 1.75rem;
|
|
400
|
+
flex: none;
|
|
401
|
+
vertical-align: middle;
|
|
402
|
+
overflow: visible;
|
|
345
403
|
}
|
|
346
|
-
.p234-
|
|
347
|
-
|
|
404
|
+
.p234-sparkline path {
|
|
405
|
+
fill: none;
|
|
406
|
+
stroke: var(--p234-color-data-flat);
|
|
407
|
+
stroke-width: var(--p234-chart-line-width);
|
|
408
|
+
stroke-linecap: round;
|
|
409
|
+
stroke-linejoin: round;
|
|
410
|
+
vector-effect: non-scaling-stroke;
|
|
348
411
|
}
|
|
412
|
+
.p234-sparkline[data-direction="up"] path { stroke: var(--p234-color-data-up); }
|
|
413
|
+
.p234-sparkline[data-direction="down"] path { stroke: var(--p234-color-data-down); }
|
|
349
414
|
|
|
350
415
|
/* --- meter -------------------------------------------------------------
|
|
351
416
|
An inline bar for one value's share of a whole: a food group's share of a
|
|
@@ -1507,6 +1572,16 @@ textarea.p234-field__control {
|
|
|
1507
1572
|
align-self: center;
|
|
1508
1573
|
}
|
|
1509
1574
|
|
|
1575
|
+
/* Many short rows at once: 106 government bonds, each a code and a price.
|
|
1576
|
+
One column of those is a scroll of a thousand pixels; laid out in columns
|
|
1577
|
+
they fit a screen. A rem minimum, never a percentage, so the columns
|
|
1578
|
+
collapse to one on a phone without the track-sizing trap. */
|
|
1579
|
+
.p234-directory--grid {
|
|
1580
|
+
display: grid;
|
|
1581
|
+
grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
|
|
1582
|
+
column-gap: var(--p234-space-7);
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1510
1585
|
@container (max-width: 26rem) {
|
|
1511
1586
|
.p234-directory__row {
|
|
1512
1587
|
display: grid;
|