@plus234feed/ds 0.5.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 +71 -18
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plus234feed/ds",
3
- "version": "0.5.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,8 +352,21 @@
315
352
  max-width: var(--p234-measure-text);
316
353
  }
317
354
  .p234-prose > * + * { margin-top: var(--p234-space-5); }
318
- .p234-prose a { color: var(--p234-color-link); text-underline-offset: 2px; }
319
- .p234-prose a:visited { color: var(--p234-color-link-visited); }
355
+ /* Links in running text, meaning links with no styling of their own.
356
+ *
357
+ * `.p234-prose a` is a class and a type, which outranks the single class on
358
+ * `.p234-btn`, so without this guard a button inside prose takes the link
359
+ * colour: brand green text on a brand green fill, which renders as an empty
360
+ * green rectangle. The same applied to a tag, a toggle and a directory row.
361
+ *
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); }
320
370
  .p234-prose blockquote {
321
371
  font-family: var(--p234-type-quote-family);
322
372
  font-size: var(--p234-type-quote-size);
@@ -461,7 +511,10 @@
461
511
  font-weight: 700;
462
512
  color: var(--p234-color-brand);
463
513
  }
464
- .p234-nextstep a {
514
+ /* Same guard as prose: a link that is already a component keeps its own
515
+ colour. Without it a button or tag dropped into this box would be styled
516
+ as one of the box's own link rows. */
517
+ .p234-nextstep a:not([class]) {
465
518
  font-family: var(--p234-type-headline-xs-family);
466
519
  font-size: var(--p234-type-headline-xs-size);
467
520
  line-height: var(--p234-type-headline-xs-leading);
@@ -469,7 +522,7 @@
469
522
  color: var(--p234-color-ink);
470
523
  text-decoration: none;
471
524
  }
472
- .p234-nextstep a:hover { text-decoration: underline; text-underline-offset: 2px; }
525
+ .p234-nextstep a:not([class]):hover { text-decoration: underline; text-underline-offset: 2px; }
473
526
 
474
527
  /* --- breadcrumb --------------------------------------------------------
475
528
  34 files hand-roll this today, each with its own separator and spacing. */
@@ -493,8 +546,8 @@
493
546
  content: "/";
494
547
  color: var(--p234-color-rule-strong);
495
548
  }
496
- .p234-breadcrumb a { color: var(--p234-color-ink-muted); text-decoration: none; }
497
- .p234-breadcrumb a: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; }
498
551
  .p234-breadcrumb [aria-current="page"] { color: var(--p234-color-ink); }
499
552
 
500
553
  /* --- figure ------------------------------------------------------------
@@ -711,7 +764,7 @@
711
764
  justify-content: center;
712
765
  gap: var(--p234-space-5);
713
766
  }
714
- .p234-masthead__editions a {
767
+ .p234-masthead__editions a:not([class]) {
715
768
  font-family: var(--p234-type-ui-sm-family);
716
769
  font-size: var(--p234-type-ui-sm-size);
717
770
  font-weight: 600;
@@ -722,7 +775,7 @@
722
775
  white-space: nowrap;
723
776
  }
724
777
  .p234-masthead__editions a:hover,
725
- .p234-masthead__editions a[aria-current] { color: var(--p234-color-ink); }
778
+ .p234-masthead__editions a:not([class])[aria-current] { color: var(--p234-color-ink); }
726
779
 
727
780
  /* Row 2: the wordmark, centred. */
728
781
  .p234-masthead__bar {
@@ -840,13 +893,13 @@
840
893
  }
841
894
  .p234-megamenu ul { list-style: none; margin: 0; padding: 0; }
842
895
  .p234-megamenu li { margin-bottom: var(--p234-space-4); }
843
- .p234-megamenu a {
896
+ .p234-megamenu a:not([class]) {
844
897
  font-family: var(--p234-type-ui-family);
845
898
  font-size: var(--p234-type-ui-size);
846
899
  color: var(--p234-color-ink);
847
900
  text-decoration: none;
848
901
  }
849
- .p234-megamenu a:hover { text-decoration: underline; text-underline-offset: 2px; }
902
+ .p234-megamenu a:not([class]):hover { text-decoration: underline; text-underline-offset: 2px; }
850
903
 
851
904
  /* The phone drawer: a full screen panel, search first, then the sections as
852
905
  accordions. <details> so it works with no JavaScript. */
@@ -880,7 +933,7 @@
880
933
  gap: var(--p234-space-4);
881
934
  padding-bottom: var(--p234-space-5);
882
935
  }
883
- .p234-drawer__links a {
936
+ .p234-drawer__links a:not([class]) {
884
937
  font-family: var(--p234-type-ui-family);
885
938
  font-size: var(--p234-type-ui-size);
886
939
  color: var(--p234-color-ink);
@@ -905,7 +958,7 @@
905
958
  max-width: var(--p234-layout-container);
906
959
  margin-inline: auto;
907
960
  }
908
- .p234-subnav a {
961
+ .p234-subnav a:not([class]) {
909
962
  display: block;
910
963
  font-family: var(--p234-type-ui-sm-family);
911
964
  font-size: var(--p234-type-ui-sm-size);
@@ -917,8 +970,8 @@
917
970
  border-bottom: var(--p234-border-thick) solid transparent;
918
971
  margin-bottom: -1px;
919
972
  }
920
- .p234-subnav a:hover { color: var(--p234-color-ink); }
921
- .p234-subnav a[aria-current] {
973
+ .p234-subnav a:not([class]):hover { color: var(--p234-color-ink); }
974
+ .p234-subnav a:not([class])[aria-current] {
922
975
  color: var(--p234-color-ink);
923
976
  border-bottom-color: var(--p234-color-brand);
924
977
  }
@@ -984,13 +1037,13 @@
984
1037
  }
985
1038
  .p234-footer ul { list-style: none; margin: 0; padding: 0; }
986
1039
  .p234-footer li { margin-bottom: var(--p234-space-3); }
987
- .p234-footer a {
1040
+ .p234-footer a:not([class]) {
988
1041
  font-family: var(--p234-type-ui-sm-family);
989
1042
  font-size: var(--p234-type-ui-sm-size);
990
1043
  color: var(--p234-color-ink);
991
1044
  text-decoration: none;
992
1045
  }
993
- .p234-footer a:hover { text-decoration: underline; text-underline-offset: 2px; }
1046
+ .p234-footer a:not([class]):hover { text-decoration: underline; text-underline-offset: 2px; }
994
1047
  .p234-footer__legal {
995
1048
  border-top: var(--p234-border-hairline) solid var(--p234-color-rule);
996
1049
  padding-top: var(--p234-space-5);
@@ -1550,7 +1603,7 @@ textarea.p234-field__control {
1550
1603
  margin: 0;
1551
1604
  padding: 0;
1552
1605
  }
1553
- .p234-linkgrid a {
1606
+ .p234-linkgrid a:not([class]) {
1554
1607
  display: block;
1555
1608
  border-top: var(--p234-border-thick) solid var(--p234-color-ink);
1556
1609
  padding-top: var(--p234-space-3);
@@ -1560,7 +1613,7 @@ textarea.p234-field__control {
1560
1613
  color: var(--p234-color-ink);
1561
1614
  text-decoration: none;
1562
1615
  }
1563
- .p234-linkgrid a:hover { color: var(--p234-color-brand); }
1616
+ .p234-linkgrid a:not([class]):hover { color: var(--p234-color-brand); }
1564
1617
  .p234-linkgrid__count {
1565
1618
  display: block;
1566
1619
  font-family: var(--p234-type-meta-family);