@plus234feed/ds 0.7.0 → 0.8.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/components.css +28 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plus234feed/ds",
3
- "version": "0.7.0",
3
+ "version": "0.8.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",
@@ -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.