@plus234feed/ds 0.7.0 → 0.9.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 +56 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plus234feed/ds",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.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
|
@@ -292,6 +292,34 @@
|
|
|
292
292
|
.p234-delta--cost[data-direction="up"] { color: var(--p234-color-data-down); }
|
|
293
293
|
.p234-delta--cost[data-direction="down"] { color: var(--p234-color-data-up); }
|
|
294
294
|
|
|
295
|
+
/* --- tile row ----------------------------------------------------------
|
|
296
|
+
The grid a row of tiles sits in. Every page that showed figures was
|
|
297
|
+
writing this inline, with a different minimum each time, and the counts
|
|
298
|
+
that left one tile alone on a second row were found by eye afterwards.
|
|
299
|
+
|
|
300
|
+
A lone tile on its own row reads as a separate section rather than the
|
|
301
|
+
fourth of four, which is the same fault the footer had with seven link
|
|
302
|
+
groups in a six column grid.
|
|
303
|
+
|
|
304
|
+
`min(100%, ...)` is what keeps a single column on a phone: without it the
|
|
305
|
+
minimum wins and the row overflows the screen. */
|
|
306
|
+
.p234-tiles {
|
|
307
|
+
display: grid;
|
|
308
|
+
gap: var(--p234-space-6);
|
|
309
|
+
grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/* Quantity queries. At the page measure a 11rem minimum fits three across,
|
|
313
|
+
so four tiles break as three and one, and seven as three, three and one.
|
|
314
|
+
A wider minimum drops those to two and four across, which divide evenly.
|
|
315
|
+
On a wider container they still fit four, and four divides four. */
|
|
316
|
+
.p234-tiles:has(> :nth-child(4):last-child) {
|
|
317
|
+
grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
|
|
318
|
+
}
|
|
319
|
+
.p234-tiles:has(> :nth-child(7):last-child) {
|
|
320
|
+
grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
|
|
321
|
+
}
|
|
322
|
+
|
|
295
323
|
/* --- meter -------------------------------------------------------------
|
|
296
324
|
An inline bar for one value's share of a whole: a food group's share of a
|
|
297
325
|
daily diet, a party's share of a vote, a source's share of coverage.
|
|
@@ -1346,7 +1374,14 @@ textarea.p234-field__control {
|
|
|
1346
1374
|
/* --- directory ---------------------------------------------------------
|
|
1347
1375
|
A long index: every equity, every state, every seat. Grouped, with the
|
|
1348
1376
|
group letter sticking as the reader scrolls past it. */
|
|
1349
|
-
.p234-directory {
|
|
1377
|
+
.p234-directory {
|
|
1378
|
+
border-top: var(--p234-border-thick) solid var(--p234-color-ink);
|
|
1379
|
+
/* So a row can lay itself out from the width it actually has, rather than
|
|
1380
|
+
the page deciding for it. A directory in a full width column and the same
|
|
1381
|
+
directory in one half of a two-up both read correctly without the page
|
|
1382
|
+
passing a variant down. */
|
|
1383
|
+
container-type: inline-size;
|
|
1384
|
+
}
|
|
1350
1385
|
.p234-directory__letter {
|
|
1351
1386
|
position: sticky;
|
|
1352
1387
|
top: 0;
|
|
@@ -1391,6 +1426,26 @@ textarea.p234-field__control {
|
|
|
1391
1426
|
color: var(--p234-color-ink);
|
|
1392
1427
|
}
|
|
1393
1428
|
|
|
1429
|
+
/* In a narrow column the three parts of a row compete for the same line and
|
|
1430
|
+
the name truncates to nothing. Below this width the detail moves under the
|
|
1431
|
+
name and the figure keeps the right edge, which is the shape a list of
|
|
1432
|
+
movers wants when two of them sit side by side. */
|
|
1433
|
+
@container (max-width: 26rem) {
|
|
1434
|
+
.p234-directory__row {
|
|
1435
|
+
display: grid;
|
|
1436
|
+
grid-template-columns: 1fr auto;
|
|
1437
|
+
column-gap: var(--p234-space-4);
|
|
1438
|
+
align-items: baseline;
|
|
1439
|
+
}
|
|
1440
|
+
.p234-directory__name { grid-area: 1 / 1; }
|
|
1441
|
+
.p234-directory__detail { grid-area: 2 / 1; }
|
|
1442
|
+
.p234-directory__value {
|
|
1443
|
+
grid-area: 1 / 2 / span 2;
|
|
1444
|
+
margin-left: 0;
|
|
1445
|
+
align-self: center;
|
|
1446
|
+
}
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1394
1449
|
/* --- chart -------------------------------------------------------------
|
|
1395
1450
|
The frame around a plot: title, legend, the plot itself, and the line
|
|
1396
1451
|
saying where the numbers came from and as of when. */
|