@undrr/undrr-mangrove 2.0.0-rc.2 → 2.0.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 (124) hide show
  1. package/README.md +11 -6
  2. package/components/BookCard.js +1 -1
  3. package/components/Breadcrumbs.js +2 -2
  4. package/components/Checkbox.js +1 -1
  5. package/components/Chips.js +1 -1
  6. package/components/CopyButton.js +2 -2
  7. package/components/CtaButton.js +1 -1
  8. package/components/Drawer.js +1 -1
  9. package/components/EmbedContainer.js +1 -1
  10. package/components/Footer.js +1 -1
  11. package/components/FormAction.js +1 -1
  12. package/components/FormErrorSummary.js +1 -1
  13. package/components/FormGroup.js +1 -1
  14. package/components/FullWidth.js +1 -1
  15. package/components/Gallery.js +2 -2
  16. package/components/Hero.js +2 -2
  17. package/components/HighlightBox.js +1 -1
  18. package/components/HorizontalBookCard.js +1 -1
  19. package/components/HorizontalCard.js +1 -1
  20. package/components/IconCard.js +1 -1
  21. package/components/Legend.js +1 -1
  22. package/components/Loader.js +1 -1
  23. package/components/MegaMenu.js +2 -2
  24. package/components/Notice.js +2 -2
  25. package/components/PageHeader.js +2 -2
  26. package/components/Pager.js +2 -2
  27. package/components/QuoteHighlight.js +2 -2
  28. package/components/QuoteHighlight.js.LICENSE.txt +2 -0
  29. package/components/Radio.js +1 -1
  30. package/components/Range.js +1 -1
  31. package/components/ScrollContainer.js +2 -2
  32. package/components/SegmentedControl.js +9 -0
  33. package/components/SegmentedControl.js.LICENSE.txt +9 -0
  34. package/components/Select.js +1 -1
  35. package/components/ServiceNotice.js +2 -2
  36. package/components/ShareButtons.js +2 -2
  37. package/components/ShowMore.js +2 -2
  38. package/components/SkipLink.js +1 -1
  39. package/components/StatsCard.js +1 -1
  40. package/components/SyndicationSearchWidget.js +2 -2
  41. package/components/Tab.js +2 -2
  42. package/components/TextCta.js +1 -1
  43. package/components/TextInput.js +1 -1
  44. package/components/Textarea.js +1 -1
  45. package/components/Tree.js +1 -1
  46. package/components/UserFeedback.js +1 -1
  47. package/components/VerticalCard.js +1 -1
  48. package/components/hydrate.js +2 -2
  49. package/css/style-all.css +60 -40
  50. package/css/style-all.css.map +1 -1
  51. package/css/style-delta.css +59 -39
  52. package/css/style-delta.css.map +1 -1
  53. package/css/style-gutenberg.css +16 -7
  54. package/css/style-gutenberg.css.map +1 -1
  55. package/css/style-irp.css +60 -40
  56. package/css/style-irp.css.map +1 -1
  57. package/css/style-mcr.css +59 -39
  58. package/css/style-mcr.css.map +1 -1
  59. package/css/style-preventionweb.css +60 -40
  60. package/css/style-preventionweb.css.map +1 -1
  61. package/css/style.css +59 -39
  62. package/css/style.css.map +1 -1
  63. package/error-pages/401.html +3 -3
  64. package/error-pages/403.html +3 -3
  65. package/error-pages/404.html +4 -4
  66. package/error-pages/429.html +3 -3
  67. package/error-pages/500.html +6 -6
  68. package/error-pages/502.html +3 -3
  69. package/error-pages/503.html +3 -3
  70. package/error-pages/504.html +3 -3
  71. package/error-pages/5xx.html +4 -4
  72. package/error-pages/challenge.html +3 -3
  73. package/error-pages/managed-challenge.html +3 -3
  74. package/js/README.md +31 -25
  75. package/js/copy-button.js +17 -0
  76. package/js/drawer.js +752 -0
  77. package/js/hub-header.js +217 -0
  78. package/js/show-more.js +144 -10
  79. package/js/switch-pending.js +195 -46
  80. package/package.json +8 -3
  81. package/scss/Atom/BaseTypography/Blockquote/blockquote.scss +2 -1
  82. package/scss/Atom/BaseTypography/Cite/cite.scss +2 -1
  83. package/scss/Atom/BaseTypography/Code/code.scss +8 -2
  84. package/scss/Atom/Icons/icons.scss +1 -1
  85. package/scss/Atom/Images/AuthorImage/author-image.scss +16 -1
  86. package/scss/Atom/StatusLabel/status-label.scss +331 -8
  87. package/scss/Atom/Table/table.scss +8 -3
  88. package/scss/Atom/Tag/tag.scss +20 -2
  89. package/scss/Components/Breadcrumbs/breadcrumbs.scss +8 -4
  90. package/scss/Components/Buttons/CtaButton/cta-button.scss +15 -0
  91. package/scss/Components/Cards/Card/card.scss +37 -10
  92. package/scss/Components/Cards/StatsCard/stats-card.scss +2 -10
  93. package/scss/Components/DataViz/Legend/legend.scss +2 -1
  94. package/scss/Components/ErrorPages/error-pages.scss +8 -0
  95. package/scss/Components/Forms/SegmentedControl/segmented-control.scss +412 -0
  96. package/scss/Components/Forms/_form-base.scss +109 -18
  97. package/scss/Components/Hero/hero.scss +296 -57
  98. package/scss/Components/MegaMenu/mega-menu.scss +26 -6
  99. package/scss/Components/OnThisPageNav/on-this-page-nav.scss +3 -1
  100. package/scss/Components/PageHeader/page-header.scss +13 -28
  101. package/scss/Components/Pager/pager.scss +3 -1
  102. package/scss/Components/QuoteHighlight/quote-highlight.scss +6 -1
  103. package/scss/Components/ScrollContainer/scroll-container.scss +11 -0
  104. package/scss/Components/SyndicationSearchWidget/syndication-search-widget.scss +51 -24
  105. package/scss/Components/Tab/tab.scss +1 -1
  106. package/scss/Components/TextCta/text-cta.scss +11 -3
  107. package/scss/Patterns/HubHeader/hub-header.scss +14 -3
  108. package/scss/Utilities/FullWidth/full-width.scss +14 -1
  109. package/scss/assets/scss/_components.scss +1 -0
  110. package/scss/assets/scss/_fonts.scss +11 -0
  111. package/scss/assets/scss/_foundational.scss +7 -0
  112. package/scss/assets/scss/_mixins.scss +32 -0
  113. package/scss/assets/scss/_tokens-data-viz.scss +9 -0
  114. package/scss/assets/scss/_variables.scss +16 -3
  115. package/scss/assets/scss/generated/_tokens-irp.scss +20 -4
  116. package/scss/assets/scss/generated/_tokens-mangrove.scss +6 -0
  117. package/scss/assets/scss/generated/_tokens-preventionweb.scss +20 -4
  118. package/js/__tests__/copy-button.test.js +0 -112
  119. package/js/__tests__/show-more.test.js +0 -80
  120. package/js/__tests__/table-of-contents.test.js +0 -196
  121. package/scss/Components/SyndicationSearchWidget/SyndicationSearchWidget.scss +0 -11
  122. package/scss/Components/TableOfContents/TableOfContents.scss +0 -11
  123. package/scss/Utilities/FullWidth/FullWidth.scss +0 -11
  124. package/scss/Utilities/ShowMore/ShowMore.scss +0 -11
@@ -6,6 +6,97 @@
6
6
  * Full documentation:
7
7
  * https://github.com/unisdr/undrr-mangrove/blob/main/stories/Components/Hero/Hero.mdx
8
8
  */
9
+ // The veil between the photograph and the copy, in two layers.
10
+
11
+ // The lower layer is the brand tint that has always been here: the hero
12
+ // colour, near-opaque at the copy's leading edge and fading to almost nothing
13
+ // at the far side so the photograph can be seen.
14
+
15
+ // The upper layer is the scrim, and it is the one that carries the contrast
16
+ // guarantee. A hero composites a gradient over an editorial photograph the
17
+ // component never sees, so no token pair describes what the copy is actually
18
+ // read against, and the contrast register cannot hold this case -- see
19
+ // `docs/COLOUR-CONTRAST-METHODOLOGY.md#the-hero-scrim`. The tint alone cannot
20
+ // do the job: where the copy ends, the tint is at its middle opacity and still
21
+ // lets about 18% of the photograph through, which over a bright sky took IRP's
22
+ // body copy to 3.9:1 (unisdr/undrr-mangrove#1256). Nor can the tint be turned
23
+ // up to fix it -- IRP's hero blue measures 4.71 against white at FULL opacity,
24
+ // so the colour has no headroom left to spend. A neutral darkening layer over
25
+ // the whole composite is the only thing that gives a floor independent of both
26
+ // the photograph and the theme.
27
+
28
+ // Both layers hold at full strength across the copy and then clear, so the
29
+ // veil darkens the region that has to be read and leaves the photograph beyond
30
+ // it alone. That is why the horizontal callers pass lengths derived from
31
+ // --mg-hero-copy-inline-end rather than percentages: that property is the same
32
+ // one the padding uses, so neither layer can drift away from the copy it is
33
+ // protecting. The tint's middle stop used to be a flat 48%, which happens to
34
+ // land near the copy's trailing edge at desktop-wide and nowhere near it
35
+ // anywhere else -- at 910px the copy reached two thirds of the way across the
36
+ // frame, into tint that had already fallen to about 0.56, and the scrim alone
37
+ // could not make that up.
38
+ // $from is where BOTH layers switch on. It defaults to the veil's own leading
39
+ // edge, which is what the horizontal callers want: a stop at 0% with zero
40
+ // opacity followed immediately by one at 0% with full opacity paints exactly
41
+ // what a single full-opacity stop at 0% painted, so passing nothing here is a
42
+ // no-op. The vertical caller below the tablet breakpoint passes the banner's
43
+ // depth instead, so the veil starts under the photograph rather than over it.
44
+ @mixin mg-hero-veil($angle, $tint-middle, $hold, $clear, $from: 0%) {
45
+ background:
46
+ linear-gradient(
47
+ $angle,
48
+ rgb(var(--mg-hero-scrim-color) / 0) #{$from},
49
+ rgb(var(--mg-hero-scrim-color) / var(--mg-hero-scrim-opacity)) #{$from},
50
+ rgb(var(--mg-hero-scrim-color) / var(--mg-hero-scrim-opacity)) #{$hold},
51
+ rgb(var(--mg-hero-scrim-color) / 0) #{$clear}
52
+ ),
53
+ linear-gradient(
54
+ $angle,
55
+ rgb(var(--mg-hero-gradient-color) / 0) #{$from},
56
+ rgb(var(--mg-hero-gradient-color) / var(--mg-hero-gradient-start))
57
+ #{$from},
58
+ rgb(var(--mg-hero-gradient-color) / var(--mg-hero-gradient-middle))
59
+ $tint-middle,
60
+ rgb(var(--mg-hero-gradient-color) / var(--mg-hero-gradient-end)) 100%
61
+ );
62
+ }
63
+
64
+ // The mobile composition: a banner and a panel, not copy over a photograph.
65
+
66
+ // Below the tablet breakpoint the vertical veil could not be made to work.
67
+ // The copy fills the frame, so the label sits at the top where the tint is
68
+ // down to its end opacity, and all five themes measured between 2.4 and 3.1
69
+ // against a bright sky (unisdr/undrr-mangrove#1264). Deepening the tint far
70
+ // enough to protect the label veils the photograph across the whole frame, at
71
+ // exactly the width where the photograph is smallest and least able to carry
72
+ // detail. So the copy moves off the frame instead: the photograph is a banner
73
+ // across the top, and the copy sits below it on the brand surface.
74
+
75
+ // What that buys is not a better number, it is a different question. With no
76
+ // photograph behind the copy the contrast is a token pair again -- white on
77
+ // the theme's hero colour, darkened by the same scrim the horizontal band
78
+ // uses -- so it is solvable rather than sampled, and no image a consumer
79
+ // uploads can move it.
80
+
81
+ // It is still the veil mixin and still the same tokens: the tint holds at
82
+ // full opacity because here it is a surface rather than a veil, which is what
83
+ // setting the three gradient opacities to 1 says. The scrim is untouched at
84
+ // its published 0.16, so the panel is the theme's hero colour under the same
85
+ // darkening the desktop copy band already gets.
86
+ @mixin mg-hero-mobile-panel() {
87
+ --mg-hero-gradient-start: 1;
88
+ --mg-hero-gradient-middle: 1;
89
+ --mg-hero-gradient-end: 1;
90
+
91
+ @include mg-hero-veil(
92
+ 180deg,
93
+ 100%,
94
+ 100%,
95
+ 100%,
96
+ var(--mg-hero-banner-block-size)
97
+ );
98
+ }
99
+
9
100
  // Hero
10
101
  // This is a test container we can use for now to ensure the hero "locks" to the grid
11
102
  // .test-container {
@@ -24,6 +115,35 @@
24
115
  --mg-hero-gradient-start: var(--mg-hero-gradient-start-opacity);
25
116
  --mg-hero-gradient-middle: var(--mg-hero-gradient-middle-opacity);
26
117
  --mg-hero-gradient-end: var(--mg-hero-gradient-end-opacity);
118
+ --mg-hero-scrim-color: var(--mg-color-neutral-900);
119
+
120
+ // Where the copy starts and ends along the inline axis. The padding reads
121
+ // the first, the scrim reads the second, so the darkened band and the text
122
+ // it protects are defined once and move together. A theme that widens
123
+ // --mg-hero-overlay-max-width widens the scrim with it, for free.
124
+ --mg-hero-copy-inline-start: var(--mg-spacing-100);
125
+
126
+ // How deep the photograph's banner is below the tablet breakpoint, and so
127
+ // also where the copy's panel begins: the padding and the veil both read
128
+ // it, the way the horizontal band reads --mg-hero-copy-inline-start. At
129
+ // 390px this is 218px, a hair under 16:9 -- banner proportions rather than
130
+ // a strip. The rem cap stops it growing into a half-screen slab as the
131
+ // frame approaches the breakpoint. A theme that wants a taller or shallower
132
+ // banner moves this one property and the panel follows.
133
+ --mg-hero-banner-block-size: min(56vw, #{mg-rem(320)});
134
+
135
+ // Clamped to the element, not just derived from it. Below --mg-hero-copy-
136
+ // inline-start is a VIEWPORT-derived length (50vw - container/2) while the
137
+ // element is only viewport-wide in the full-bleed case; --contained makes it
138
+ // its parent's width instead. Without the clamp a band wider than the
139
+ // element leaves the tint's middle stop past 100%, so the tint never
140
+ // finishes its ramp to --mg-hero-gradient-end and the photograph is covered
141
+ // edge to edge. The clamp cannot cost contrast: it only ever pulls the band
142
+ // in to where the element ends, and the copy cannot be painted past that.
143
+ --mg-hero-copy-inline-end: min(
144
+ 100%,
145
+ calc(var(--mg-hero-copy-inline-start) + var(--mg-hero-overlay-max-width))
146
+ );
27
147
 
28
148
  background-size: cover;
29
149
  background-position: center;
@@ -31,46 +151,134 @@
31
151
  display: grid;
32
152
  grid-template-columns: 1fr;
33
153
  position: relative;
34
- margin-left: calc(50% - (50vw)); // to expand out of the parent container
35
- padding-left: var(--mg-spacing-100);
154
+
155
+ // Logical, so the full-bleed escape out of the parent container mirrors in RTL.
156
+ margin-inline-start: calc(50% - (50vw));
157
+ padding-inline-start: var(--mg-hero-copy-inline-start);
36
158
  width: 100vw;
37
159
 
38
160
  &:not(.mg-hero--split)::before {
39
- background: linear-gradient(
161
+ @include mg-hero-veil(
40
162
  90deg,
41
- rgb(var(--mg-hero-gradient-color) / var(--mg-hero-gradient-start)) 0%,
42
- rgb(var(--mg-hero-gradient-color) / var(--mg-hero-gradient-middle)) 48%,
43
- rgb(var(--mg-hero-gradient-color) / var(--mg-hero-gradient-end)) 100%
163
+ var(--mg-hero-copy-inline-end),
164
+ var(--mg-hero-copy-inline-end),
165
+ calc(var(--mg-hero-copy-inline-end) + var(--mg-hero-scrim-fade))
44
166
  );
167
+
45
168
  content: "";
46
169
  inset: 0;
47
170
  pointer-events: none;
48
171
  position: absolute;
49
172
 
173
+ // Below tablet there is no copy over the photograph to veil: the panel
174
+ // starts where the banner ends. See the mixin, and
175
+ // docs/COLOUR-CONTRAST-METHODOLOGY.md#the-hero-scrim.
50
176
  @media (max-width: $mg-breakpoint-tablet) {
51
- background: linear-gradient(
52
- 0deg,
53
- rgb(var(--mg-hero-gradient-color) / var(--mg-hero-gradient-start)) 0%,
54
- rgb(var(--mg-hero-gradient-color) / var(--mg-hero-gradient-middle)) 68%,
55
- rgb(var(--mg-hero-gradient-color) / var(--mg-hero-gradient-end)) 100%
56
- );
177
+ @include mg-hero-mobile-panel;
178
+ }
179
+ }
180
+
181
+ // Below the tablet breakpoint the photograph is a banner across the top of
182
+ // the frame and the copy sits on a solid panel below it.
183
+
184
+ // The banner is ::after rather than the element's own background because
185
+ // the element is as tall as its copy here, and `cover` over a box that tall
186
+ // and that narrow crops a wide editorial photograph to an unrecognisable
187
+ // column. ::after takes the consumer's image with `background-image:
188
+ // inherit` -- the inline style on .mg-hero is its computed value -- and
189
+ // covers a box of known proportions instead. That is also why the element's
190
+ // own painting is sized away rather than set to `none`: `none` would be the
191
+ // computed value ::after inherits, and the banner would lose its
192
+ // photograph. This needs no new element and no script, so a consumer who
193
+ // hand-authors the markup and takes the stylesheet alone gets it too.
194
+ &:not(.mg-hero--split) {
195
+ @media (max-width: $mg-breakpoint-tablet) {
196
+ // The two tablet-breakpoint queries in this file are both inclusive, so
197
+ // at exactly 900px the banner rules and `aspect-ratio: 16 / 4` both
198
+ // apply -- and 16:4 of 900px is 225px, shallower than the banner's own
199
+ // padding, so the copy would spill out of the box it is meant to sit
200
+ // in. The mobile composition is the one that wins at the boundary,
201
+ // because the veil below already does; height comes from the banner
202
+ // plus the copy there, as it does at every narrower width.
203
+ aspect-ratio: auto;
204
+ background-color: rgb(var(--mg-color-hero));
205
+ background-size: 0 0;
206
+ padding-block-start: var(--mg-hero-banner-block-size);
207
+
208
+ &::after {
209
+ background-image: inherit;
210
+ background-position: center;
211
+ background-size: cover;
212
+ block-size: var(--mg-hero-banner-block-size);
213
+ content: "";
214
+ inset-block-start: 0;
215
+ inset-inline: 0;
216
+ pointer-events: none;
217
+ position: absolute;
218
+ }
219
+ }
220
+ }
221
+
222
+ // A hero with no photograph has nothing for the banner to inherit, and a
223
+ // banner with nothing in it is not a photograph missing -- it is a slab of
224
+ // flat brand colour holding the copy a third of a screen further down for
225
+ // no reason a reader can see. `background-image` is a painted value, so no
226
+ // selector can ask whether one resolved; the component says so instead, and
227
+ // hand-authored markup without an image has to say so too. See Hero.mdx.
228
+
229
+ // Collapsing the banner rather than opting out of the mobile block is what
230
+ // keeps the contrast: at zero depth the veil's offset is zero, so the panel
231
+ // starts at the top of the frame and the copy stays on the same solid
232
+ // surface it has at every other width. Opting out would restore the old
233
+ // full-height veil over nothing, which is the composition #1264 was about.
234
+
235
+ // Three classes deliberately: `--immersive` re-points the same property from
236
+ // a two-class selector further down the file, and a deeper banner is exactly
237
+ // what an image-less hero must not get. Winning on specificity rather than
238
+ // on source order means this cannot be undone by moving a block.
239
+ &.mg-hero--no-image:not(.mg-hero--split) {
240
+ @media (max-width: $mg-breakpoint-tablet) {
241
+ --mg-hero-banner-block-size: 0px;
57
242
  }
58
243
  }
59
244
 
60
245
  @media (min-width: $mg-breakpoint-tablet) {
61
246
  aspect-ratio: 16 / 4; // we use 16:4, which is closer to the real crop ratio
62
- padding-left: calc(
63
- 50vw - calc($mg-breakpoint-desktop / 2)
247
+
248
+ // Interpolated, not read as a Sass variable: a custom property's value is
249
+ // an unevaluated token stream, so `$mg-breakpoint-desktop` would reach the
250
+ // browser as literal text and take the whole declaration down with it.
251
+
252
+ // Floored at zero. Between the tablet and desktop breakpoints this
253
+ // expression is negative; padding clamps a negative value to zero on its
254
+ // own, but the scrim reads the same property as a gradient stop, where a
255
+ // negative start would pull the protected band back off the copy.
256
+ --mg-hero-copy-inline-start: max(
257
+ 0px,
258
+ calc(50vw - calc(#{$mg-breakpoint-desktop} / 2))
64
259
  ); // to keep the overlay fixed
65
260
  }
66
261
 
67
262
  @media (min-width: $mg-breakpoint-desktop-wide) {
68
- padding-left: calc(
69
- 50vw - calc($mg-breakpoint-desktop-wide / 2)
263
+ --mg-hero-copy-inline-start: max(
264
+ 0px,
265
+ calc(50vw - calc(#{$mg-breakpoint-desktop-wide} / 2))
70
266
  ); // to keep the overlay fixed
71
267
  }
72
268
 
73
269
  &--contained {
270
+ // The copy no longer pays the full-bleed padding, so the property that
271
+ // padding reads has to be zeroed with it. Leaving it at its viewport-
272
+ // derived value pushed the protected band a whole 50vw - container/2
273
+ // beyond where the copy actually ends -- 240px at 1920 -- which is the
274
+ // one direction the "defined once, they move together" invariant can be
275
+ // broken, because --contained is the only modifier that changes the
276
+ // padding without going through this property.
277
+
278
+ // Must stay AFTER the min-width media queries above: a class selector and
279
+ // a media query carry the same specificity, so source order decides.
280
+ --mg-hero-copy-inline-start: 0px;
281
+
74
282
  margin-inline: 0;
75
283
  padding-inline: 0;
76
284
  width: 100%;
@@ -81,10 +289,29 @@
81
289
  aspect-ratio: unset;
82
290
  min-height: clamp(mg-rem(496), 62vw, mg-rem(688));
83
291
 
292
+ // The immersive height exists to give the photograph room BEHIND the
293
+ // copy. Below the tablet breakpoint the copy is no longer over the
294
+ // photograph, so holding that height would only stretch the solid panel
295
+ // and push the copy to the bottom of a tall block of flat colour. Give
296
+ // the room to the banner instead: immersive stays the taller, more
297
+ // editorial hero, and the difference is in the photograph rather than in
298
+ // an expanse of brand colour.
299
+ @media (max-width: $mg-breakpoint-tablet) {
300
+ --mg-hero-banner-block-size: min(78vw, #{mg-rem(440)});
301
+
302
+ align-items: start;
303
+ min-height: 0;
304
+ }
305
+
306
+ // Immersive widens the copy column, so it moves the shared property
307
+ // rather than the overlay's own max-width: the scrim reads the same one
308
+ // and has to widen with it.
309
+ --mg-hero-overlay-max-width: #{mg-rem(768)};
310
+
84
311
  .mg-hero__overlay {
85
312
  align-items: end;
86
313
  margin: 0;
87
- max-width: mg-rem(768);
314
+ max-width: var(--mg-hero-overlay-max-width);
88
315
  padding: clamp(mg-rem(32), 6vw, mg-rem(80));
89
316
  }
90
317
 
@@ -153,6 +380,7 @@
153
380
 
154
381
  &__content {
155
382
  display: grid;
383
+ min-width: 0;
156
384
  margin-top: var(--mg-spacing-25);
157
385
  row-gap: mg-rem(10);
158
386
  }
@@ -174,10 +402,14 @@
174
402
 
175
403
  &__label {
176
404
  display: inline-block;
405
+ min-width: 0;
177
406
  font-family: var(--mg-font-family-ui);
178
407
  font-size: var(--mg-font-size-250);
179
408
  font-weight: bold;
180
- margin-right: var(--mg-spacing-25);
409
+
410
+ // Same shrink-to-fit escape as the title -- see the note there.
411
+ max-width: 100%;
412
+ margin-inline-end: var(--mg-spacing-25);
181
413
  padding: var(--mg-spacing-25) 0;
182
414
 
183
415
  &.detail {
@@ -201,6 +433,7 @@
201
433
  // Hero title typography.
202
434
  &__title {
203
435
  color: rgb(var(--mg-color-hero-title));
436
+ min-width: 0;
204
437
  margin-bottom: var(--mg-spacing-25);
205
438
  display: inline-block;
206
439
  font-family: var(--mg-font-family-display);
@@ -209,6 +442,16 @@
209
442
  line-height: 1.2;
210
443
  text-wrap: balance;
211
444
 
445
+ // The veil protects a band the width of the copy column, so no glyph may
446
+ // leave that column. `display: inline-block` shrink-to-fits, and
447
+ // `overflow-wrap: break-word` (inherited from the foundational layer)
448
+ // does NOT reduce a box's min-content size -- so a single long word sized
449
+ // the title box past the overlay and painted over the bare photograph. A
450
+ // 48-character German compound escaped the band by 259px at both 1440 and
451
+ // 1920, 99px of it beyond the scrim's fade. Capping the box makes the
452
+ // inherited break-word actually apply.
453
+ max-width: 100%;
454
+
212
455
  @media (max-width: $mg-breakpoint-mobile) {
213
456
  font-size: var(--mg-font-size-600);
214
457
  }
@@ -255,13 +498,16 @@
255
498
  // Child variant
256
499
  .mg-hero--child .mg-hero__overlay {
257
500
  @media (max-width: $mg-breakpoint-tablet) {
258
- margin-left: 0;
501
+ margin-inline-start: 0;
259
502
  }
260
503
  }
261
504
 
262
- // Stylistic variants
505
+ // Stylistic variants. Each entry is a surface: the flat fill for split, the
506
+ // gradient over the photo for the background layout, and the CTA label's ink on
507
+ // the white pill. So only a colour that carries text belongs in this map, which
508
+ // is why "secondary" is not in it — the orange accent is 2.65 under white copy
509
+ // and the same 2.65 as ink on the pill. It is handled below instead, as a rule.
263
510
  $variant-colour-props: (
264
- "secondary": "--mg-color-orange-800",
265
511
  "tertiary": "--mg-color-neutral-900",
266
512
  "quaternary": "--mg-color-red-800",
267
513
  );
@@ -290,45 +536,40 @@ $variant-colour-props: (
290
536
  }
291
537
  }
292
538
 
293
- // RTL tweaks (background layout only)
294
- [dir="rtl"] .mg-hero:not(.mg-hero--split) {
295
- margin-right: calc(50% - (50vw)); // to expand out of the parent container
296
- padding-right: var(--mg-spacing-100);
539
+ // The secondary hero keeps the theme's own hero surface, which already carries
540
+ // white copy in all five themes, and wears the Sendai orange as a solid rule
541
+ // along its leading edge — a block of colour with no copy over it. It reads the
542
+ // published token rather than the ramp step, so a theme that retargets
543
+ // --mg-color-hero--secondary moves the rule with it. Before this, the map above
544
+ // hardcoded --mg-color-orange-800 here, which resolved to the same colour and
545
+ // hid the split.
546
+ .mg-hero--secondary {
547
+ border-inline-start: mg-rem(8) solid rgb(var(--mg-color-hero--secondary));
548
+ }
297
549
 
550
+ // RTL tweaks (background layout only).
551
+ // The full-bleed escape and the overlay inset use logical properties on
552
+ // `.mg-hero`, so they already mirror; only the gradient direction needs flipping.
553
+ // Only the angle changes: a gradient's stops are measured from its own start,
554
+ // so the same copy-derived length lands on the copy once the axis is flipped.
555
+ [dir="rtl"] .mg-hero:not(.mg-hero--split) {
298
556
  &::before {
299
- background: linear-gradient(
557
+ @include mg-hero-veil(
300
558
  270deg,
301
- rgb(var(--mg-hero-gradient-color) / var(--mg-hero-gradient-start)) 0%,
302
- rgb(var(--mg-hero-gradient-color) / var(--mg-hero-gradient-middle)) 48%,
303
- rgb(var(--mg-hero-gradient-color) / var(--mg-hero-gradient-end)) 100%
559
+ var(--mg-hero-copy-inline-end),
560
+ var(--mg-hero-copy-inline-end),
561
+ calc(var(--mg-hero-copy-inline-end) + var(--mg-hero-scrim-fade))
304
562
  );
305
563
 
564
+ // The banner and the panel are stacked along the BLOCK axis, which does
565
+ // not mirror, so this is the same call as the LTR one. It has to be
566
+ // repeated all the same: the RTL selector outranks the base rule on
567
+ // specificity, so leaving it out would restore the horizontal veil on an
568
+ // Arabic phone.
306
569
  @media (max-width: $mg-breakpoint-tablet) {
307
- background: linear-gradient(
308
- 0deg,
309
- rgb(var(--mg-hero-gradient-color) / var(--mg-hero-gradient-start)) 0%,
310
- rgb(var(--mg-hero-gradient-color) / var(--mg-hero-gradient-middle)) 68%,
311
- rgb(var(--mg-hero-gradient-color) / var(--mg-hero-gradient-end)) 100%
312
- );
570
+ @include mg-hero-mobile-panel;
313
571
  }
314
572
  }
315
-
316
- @media (min-width: $mg-breakpoint-tablet) {
317
- padding-right: calc(
318
- 50vw - calc($mg-breakpoint-desktop / 2)
319
- ); // to keep the overlay fixed
320
- }
321
-
322
- @media (min-width: $mg-breakpoint-desktop-wide) {
323
- padding-right: calc(
324
- 50vw - calc($mg-breakpoint-desktop-wide / 2)
325
- ); // to keep the overlay fixed
326
- }
327
- }
328
-
329
- [dir="rtl"] .mg-hero--contained:not(.mg-hero--split) {
330
- margin-inline: 0;
331
- padding-inline: 0;
332
573
  }
333
574
 
334
575
  // Split layout variant
@@ -337,7 +578,7 @@ $variant-colour-props: (
337
578
  aspect-ratio: unset;
338
579
 
339
580
  // Reset background-layout padding offsets
340
- padding-left: 0;
581
+ padding-inline-start: 0;
341
582
  background-color: rgb(var(--mg-color-hero));
342
583
 
343
584
  // Button/CTA overrides (mirrors background layout, but scoped to split section
@@ -500,11 +741,9 @@ $variant-colour-props: (
500
741
  }
501
742
  }
502
743
 
503
- // RTL for split: reset outer offsets and reverse column order via grid direction
744
+ // RTL for split: reverse column order via grid direction. The full-bleed
745
+ // escape is logical, so it mirrors without an override.
504
746
  [dir="rtl"] .mg-hero--split {
505
- margin-right: 0;
506
- padding-right: 0;
507
-
508
747
  .mg-hero__split-grid {
509
748
  direction: rtl; // reverses grid item order (content stays first semantically)
510
749
  }
@@ -18,6 +18,12 @@
18
18
  display: flex;
19
19
  align-items: flex-start;
20
20
  z-index: var(--mg-z-index-nav);
21
+
22
+ // In the default variant this class is on the nav <ul> itself (the branded
23
+ // variant puts it on a wrapping <div> and uses &__nav for the list), so it
24
+ // is a list class and carries the house rule.
25
+ @include mg-list-unmarked;
26
+
21
27
  padding: 0;
22
28
  max-width: $mg-breakpoint-desktop;
23
29
  margin: 0 auto;
@@ -62,7 +68,9 @@
62
68
  display: flex;
63
69
  justify-content: flex-end;
64
70
  flex: 1;
65
- list-style: none;
71
+
72
+ @include mg-list-unmarked;
73
+
66
74
  margin: 0;
67
75
  padding: 0;
68
76
  }
@@ -95,7 +103,8 @@
95
103
  flex: 1;
96
104
  padding: 0;
97
105
  margin: 0;
98
- list-style: none;
106
+
107
+ @include mg-list-unmarked;
99
108
 
100
109
  // Clip overflow on mobile so the scrolling content hint works correctly.
101
110
  // pointer-events is left as auto here — it is restricted only when JS has
@@ -139,7 +148,13 @@
139
148
  font-size: var(--mg-font-size-300);
140
149
  color: rgb(var(--mg-color-interactive));
141
150
  font-weight: bold;
142
- list-style: none;
151
+
152
+ // The marker is hidden on the item, not only on the list. A bare
153
+ // `list-style: none` here would win over the empty-string marker the
154
+ // parent list sets, and it is the item's marker Safari looks at, so the
155
+ // list role would be dropped again. Keep the mixin on both.
156
+ @include mg-list-unmarked;
157
+
143
158
  padding: 0;
144
159
  margin: 0;
145
160
 
@@ -600,7 +615,10 @@
600
615
  }
601
616
 
602
617
  .mg-mega-sidebar-section {
603
- list-style: none;
618
+ // This is the <li> inside .mg-mega-sidebar__list. A bare `list-style: none`
619
+ // here overrides the empty-string marker the list sets, and the item's
620
+ // marker is the one Safari inspects, so the list role would be lost again.
621
+ @include mg-list-unmarked;
604
622
 
605
623
  ol {
606
624
  list-style: none;
@@ -968,7 +986,8 @@
968
986
  margin-block: var(--mg-spacing-150);
969
987
  margin-inline: calc(-1 * var(--mg-spacing-100));
970
988
  padding: 0;
971
- list-style: none;
989
+
990
+ @include mg-list-unmarked;
972
991
  }
973
992
 
974
993
  .mg-mega-sidebar-section {
@@ -1064,7 +1083,8 @@
1064
1083
  }
1065
1084
 
1066
1085
  .mg-mega-topbar__mobile-trigger {
1067
- list-style: none;
1086
+ @include mg-list-unmarked;
1087
+
1068
1088
  margin: 0;
1069
1089
  padding: 0;
1070
1090
 
@@ -49,7 +49,9 @@
49
49
  &__list {
50
50
  display: flex;
51
51
  align-items: center;
52
- list-style: none;
52
+
53
+ @include mg-list-unmarked;
54
+
53
55
  margin: 0;
54
56
  padding: 0;
55
57
  overflow-x: auto;
@@ -124,19 +124,24 @@
124
124
 
125
125
  // languageDisplay="links" — an inline list of language buttons instead of
126
126
  // the icon-only dropdown, for sites with few enough languages that
127
- // spelling them out directly is worth the toolbar space (see
128
- // .mg-page-header__language-links below). The <select>/<form> pair stays
129
- // in the DOM (the buttons drive it via JS) but is fully hidden here,
130
- // unlike the dropdown variant's sr-only-but-focusable treatment — it's a
131
- // redundant implementation detail in this mode, not a second way to
132
- // reach the same control, so it should be reachable by neither pointer
133
- // nor keyboard nor screen reader.
127
+ // spelling them out directly is worth the toolbar space. Only above
128
+ // tablet: on narrower screens even a short list wraps under the logo, so
129
+ // the links hide and the regular dropdown (.mg-page-header__block--
130
+ // language-fallback) takes over. display: none, not just visual hiding,
131
+ // so only one of the two controls is ever in the tab order and the
132
+ // accessibility tree.
134
133
  &__block--language-links {
135
134
  display: flex;
136
135
  align-items: center;
137
136
  margin-inline-start: var(--mg-spacing-75);
138
137
 
139
- .mg-page-header__lang-form {
138
+ @media (max-width: $mg-breakpoint-tablet) {
139
+ display: none;
140
+ }
141
+ }
142
+
143
+ &__block--language-fallback {
144
+ @media (min-width: $mg-breakpoint-tablet + 1) {
140
145
  display: none;
141
146
  }
142
147
  }
@@ -177,26 +182,6 @@
177
182
  }
178
183
  }
179
184
 
180
- &__language-link-code {
181
- display: none;
182
- }
183
-
184
- // Below tablet, swap the full language name for its 2-letter code — the
185
- // same value already used as the <option>'s value (and, by convention in
186
- // this component's examples, an ISO 639-1 code), so no separate prop is
187
- // needed. Both spans carry aria-hidden="true": the button's own
188
- // aria-label (the full name) is what a screen reader announces either
189
- // way, so this swap is purely visual.
190
- @media (max-width: $mg-breakpoint-tablet) {
191
- &__language-link-full {
192
- display: none;
193
- }
194
-
195
- &__language-link-code {
196
- display: inline;
197
- }
198
- }
199
-
200
185
  // Sizing and crop behavior now live on the Logo atom itself
201
186
  // (stories/Atom/Logo/logo.scss, .mg-logo--autocrop) — this class is kept
202
187
  // as a styling hook for consumers targeting the header's logo image.
@@ -25,7 +25,9 @@
25
25
  align-items: center;
26
26
  justify-content: center;
27
27
  gap: var(--mg-spacing-50);
28
- list-style: none;
28
+
29
+ @include mg-list-unmarked;
30
+
29
31
  margin: 0;
30
32
  padding: 0;
31
33
  }
@@ -223,7 +223,12 @@
223
223
  }
224
224
 
225
225
  &--dark {
226
- background-color: rgb(var(--mg-color-blue-900) / 0.7);
226
+ // Opaque, not a 0.7 wash. Under alpha the quote's contrast depends on
227
+ // whatever the component is placed over, so the library could only promise
228
+ // AA on a white page — and on white the wash composited to #4d84b2, which
229
+ // put the quote, the name and the title at 3.99:1. Solid blue-900 is
230
+ // 8.31:1 against white text on any backdrop.
231
+ background-color: rgb(var(--mg-color-blue-900));
227
232
  color: rgb(var(--mg-color-white));
228
233
 
229
234
  .mg-quote-highlight__quote {