@plus234feed/ds 0.6.0 → 0.7.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 +62 -21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plus234feed/ds",
3
- "version": "0.6.0",
3
+ "version": "0.7.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",
@@ -280,6 +280,43 @@
280
280
  .p234-delta[data-direction="up"]::before { content: "\25B2 "; }
281
281
  .p234-delta[data-direction="down"]::before { content: "\25BC "; }
282
282
 
283
+ /* On a cost page a rise is the bad news.
284
+ *
285
+ * The default above is a market reading: up is green because a price you hold
286
+ * went up. On petrol, food, transport and the cost of a healthy diet the same
287
+ * arrow means a household pays more, so the two colours swap. The arrow still
288
+ * points the way the number moved; only good and bad change places.
289
+ *
290
+ * This existed as a helper in the application for a while, which meant the
291
+ * next cost page would have invented its own. */
292
+ .p234-delta--cost[data-direction="up"] { color: var(--p234-color-data-down); }
293
+ .p234-delta--cost[data-direction="down"] { color: var(--p234-color-data-up); }
294
+
295
+ /* --- meter -------------------------------------------------------------
296
+ An inline bar for one value's share of a whole: a food group's share of a
297
+ daily diet, a party's share of a vote, a source's share of coverage.
298
+
299
+ Not to be confused with .p234-progress, which is the fixed reading bar
300
+ pinned to the top of the viewport. Using that one inline stacks every bar
301
+ on the page at the top of the screen, which is exactly what happened the
302
+ first time this was needed.
303
+
304
+ The share is carried by an aria-label on the element, because a bar on its
305
+ own is read out as nothing at all. */
306
+ .p234-meter {
307
+ display: block;
308
+ height: var(--p234-border-thick);
309
+ background: var(--p234-color-rule);
310
+ overflow: hidden;
311
+ }
312
+ .p234-meter__fill {
313
+ display: block;
314
+ height: 100%;
315
+ background: var(--p234-color-brand);
316
+ }
317
+ /* A second series in the same list, for a comparison bar under the first. */
318
+ .p234-meter__fill--alt { background: var(--p234-color-ink-subtle); }
319
+
283
320
  .p234-table {
284
321
  width: 100%;
285
322
  border-collapse: collapse;
@@ -315,17 +352,21 @@
315
352
  max-width: var(--p234-measure-text);
316
353
  }
317
354
  .p234-prose > * + * { margin-top: var(--p234-space-5); }
318
- /* Links in running text, but not links that are already a component.
355
+ /* Links in running text, meaning links with no styling of their own.
319
356
  *
320
357
  * `.p234-prose a` is a class and a type, which outranks the single class on
321
358
  * `.p234-btn`, so without this guard a button inside prose takes the link
322
359
  * colour: brand green text on a brand green fill, which renders as an empty
323
360
  * green rectangle. The same applied to a tag, a toggle and a directory row.
324
361
  *
325
- * Excluding anything that carries a p234- class keeps the component in charge
326
- * of its own colour, which is the rule everywhere else in here. */
327
- .p234-prose a:not([class*="p234-"]) { color: var(--p234-color-link); text-underline-offset: 2px; }
328
- .p234-prose a:not([class*="p234-"]):visited { color: var(--p234-color-link-visited); }
362
+ * The guard excludes any link carrying a class, not only a p234- one, because
363
+ * the first version missed a link styled by the host application's own
364
+ * utilities and it went green on green too. The rule is now simply: an
365
+ * unstyled link gets prose styling, and a link with a class styles itself.
366
+ * `:not([class])` rather than `:where()` so it does not depend on whether
367
+ * this stylesheet is imported before or after the host's reset. */
368
+ .p234-prose a:not([class]) { color: var(--p234-color-link); text-underline-offset: 2px; }
369
+ .p234-prose a:not([class]):visited { color: var(--p234-color-link-visited); }
329
370
  .p234-prose blockquote {
330
371
  font-family: var(--p234-type-quote-family);
331
372
  font-size: var(--p234-type-quote-size);
@@ -473,7 +514,7 @@
473
514
  /* Same guard as prose: a link that is already a component keeps its own
474
515
  colour. Without it a button or tag dropped into this box would be styled
475
516
  as one of the box's own link rows. */
476
- .p234-nextstep a:not([class*="p234-"]) {
517
+ .p234-nextstep a:not([class]) {
477
518
  font-family: var(--p234-type-headline-xs-family);
478
519
  font-size: var(--p234-type-headline-xs-size);
479
520
  line-height: var(--p234-type-headline-xs-leading);
@@ -481,7 +522,7 @@
481
522
  color: var(--p234-color-ink);
482
523
  text-decoration: none;
483
524
  }
484
- .p234-nextstep a:not([class*="p234-"]):hover { text-decoration: underline; text-underline-offset: 2px; }
525
+ .p234-nextstep a:not([class]):hover { text-decoration: underline; text-underline-offset: 2px; }
485
526
 
486
527
  /* --- breadcrumb --------------------------------------------------------
487
528
  34 files hand-roll this today, each with its own separator and spacing. */
@@ -505,8 +546,8 @@
505
546
  content: "/";
506
547
  color: var(--p234-color-rule-strong);
507
548
  }
508
- .p234-breadcrumb a:not([class*="p234-"]) { color: var(--p234-color-ink-muted); text-decoration: none; }
509
- .p234-breadcrumb a:not([class*="p234-"]):hover { color: var(--p234-color-ink); text-decoration: underline; text-underline-offset: 2px; }
549
+ .p234-breadcrumb a:not([class]) { color: var(--p234-color-ink-muted); text-decoration: none; }
550
+ .p234-breadcrumb a:not([class]):hover { color: var(--p234-color-ink); text-decoration: underline; text-underline-offset: 2px; }
510
551
  .p234-breadcrumb [aria-current="page"] { color: var(--p234-color-ink); }
511
552
 
512
553
  /* --- figure ------------------------------------------------------------
@@ -723,7 +764,7 @@
723
764
  justify-content: center;
724
765
  gap: var(--p234-space-5);
725
766
  }
726
- .p234-masthead__editions a:not([class*="p234-"]) {
767
+ .p234-masthead__editions a:not([class]) {
727
768
  font-family: var(--p234-type-ui-sm-family);
728
769
  font-size: var(--p234-type-ui-sm-size);
729
770
  font-weight: 600;
@@ -734,7 +775,7 @@
734
775
  white-space: nowrap;
735
776
  }
736
777
  .p234-masthead__editions a:hover,
737
- .p234-masthead__editions a:not([class*="p234-"])[aria-current] { color: var(--p234-color-ink); }
778
+ .p234-masthead__editions a:not([class])[aria-current] { color: var(--p234-color-ink); }
738
779
 
739
780
  /* Row 2: the wordmark, centred. */
740
781
  .p234-masthead__bar {
@@ -852,13 +893,13 @@
852
893
  }
853
894
  .p234-megamenu ul { list-style: none; margin: 0; padding: 0; }
854
895
  .p234-megamenu li { margin-bottom: var(--p234-space-4); }
855
- .p234-megamenu a:not([class*="p234-"]) {
896
+ .p234-megamenu a:not([class]) {
856
897
  font-family: var(--p234-type-ui-family);
857
898
  font-size: var(--p234-type-ui-size);
858
899
  color: var(--p234-color-ink);
859
900
  text-decoration: none;
860
901
  }
861
- .p234-megamenu a:not([class*="p234-"]):hover { text-decoration: underline; text-underline-offset: 2px; }
902
+ .p234-megamenu a:not([class]):hover { text-decoration: underline; text-underline-offset: 2px; }
862
903
 
863
904
  /* The phone drawer: a full screen panel, search first, then the sections as
864
905
  accordions. <details> so it works with no JavaScript. */
@@ -892,7 +933,7 @@
892
933
  gap: var(--p234-space-4);
893
934
  padding-bottom: var(--p234-space-5);
894
935
  }
895
- .p234-drawer__links a:not([class*="p234-"]) {
936
+ .p234-drawer__links a:not([class]) {
896
937
  font-family: var(--p234-type-ui-family);
897
938
  font-size: var(--p234-type-ui-size);
898
939
  color: var(--p234-color-ink);
@@ -917,7 +958,7 @@
917
958
  max-width: var(--p234-layout-container);
918
959
  margin-inline: auto;
919
960
  }
920
- .p234-subnav a:not([class*="p234-"]) {
961
+ .p234-subnav a:not([class]) {
921
962
  display: block;
922
963
  font-family: var(--p234-type-ui-sm-family);
923
964
  font-size: var(--p234-type-ui-sm-size);
@@ -929,8 +970,8 @@
929
970
  border-bottom: var(--p234-border-thick) solid transparent;
930
971
  margin-bottom: -1px;
931
972
  }
932
- .p234-subnav a:not([class*="p234-"]):hover { color: var(--p234-color-ink); }
933
- .p234-subnav a:not([class*="p234-"])[aria-current] {
973
+ .p234-subnav a:not([class]):hover { color: var(--p234-color-ink); }
974
+ .p234-subnav a:not([class])[aria-current] {
934
975
  color: var(--p234-color-ink);
935
976
  border-bottom-color: var(--p234-color-brand);
936
977
  }
@@ -996,13 +1037,13 @@
996
1037
  }
997
1038
  .p234-footer ul { list-style: none; margin: 0; padding: 0; }
998
1039
  .p234-footer li { margin-bottom: var(--p234-space-3); }
999
- .p234-footer a:not([class*="p234-"]) {
1040
+ .p234-footer a:not([class]) {
1000
1041
  font-family: var(--p234-type-ui-sm-family);
1001
1042
  font-size: var(--p234-type-ui-sm-size);
1002
1043
  color: var(--p234-color-ink);
1003
1044
  text-decoration: none;
1004
1045
  }
1005
- .p234-footer a:not([class*="p234-"]):hover { text-decoration: underline; text-underline-offset: 2px; }
1046
+ .p234-footer a:not([class]):hover { text-decoration: underline; text-underline-offset: 2px; }
1006
1047
  .p234-footer__legal {
1007
1048
  border-top: var(--p234-border-hairline) solid var(--p234-color-rule);
1008
1049
  padding-top: var(--p234-space-5);
@@ -1562,7 +1603,7 @@ textarea.p234-field__control {
1562
1603
  margin: 0;
1563
1604
  padding: 0;
1564
1605
  }
1565
- .p234-linkgrid a:not([class*="p234-"]) {
1606
+ .p234-linkgrid a:not([class]) {
1566
1607
  display: block;
1567
1608
  border-top: var(--p234-border-thick) solid var(--p234-color-ink);
1568
1609
  padding-top: var(--p234-space-3);
@@ -1572,7 +1613,7 @@ textarea.p234-field__control {
1572
1613
  color: var(--p234-color-ink);
1573
1614
  text-decoration: none;
1574
1615
  }
1575
- .p234-linkgrid a:not([class*="p234-"]):hover { color: var(--p234-color-brand); }
1616
+ .p234-linkgrid a:not([class]):hover { color: var(--p234-color-brand); }
1576
1617
  .p234-linkgrid__count {
1577
1618
  display: block;
1578
1619
  font-family: var(--p234-type-meta-family);