@undrr/undrr-mangrove 2.1.1 → 2.3.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 (208) hide show
  1. package/README.md +1 -1
  2. package/components/BookCard.js +1 -1
  3. package/components/Breadcrumbs.js +1 -1
  4. package/components/Checkbox.js +1 -1
  5. package/components/Chips.js +1 -1
  6. package/components/ContentCard.js +9 -0
  7. package/components/ContentCard.js.LICENSE.txt +9 -0
  8. package/components/ContentTeaser.js +9 -0
  9. package/components/ContentTeaser.js.LICENSE.txt +9 -0
  10. package/components/CopyButton.js +2 -2
  11. package/components/CtaButton.js +1 -1
  12. package/components/Drawer.js +2 -2
  13. package/components/Drawer.js.LICENSE.txt +1 -1
  14. package/components/DrupalContentPatterns.js +8 -0
  15. package/components/EmbedContainer.js +1 -1
  16. package/components/Footer.js +1 -1
  17. package/components/FormAction.js +1 -1
  18. package/components/FormErrorSummary.js +1 -1
  19. package/components/FormGroup.js +1 -1
  20. package/components/FullWidth.js +1 -1
  21. package/components/Gallery.js +2 -2
  22. package/components/Hero.js +1 -1
  23. package/components/HighlightBox.js +1 -1
  24. package/components/HorizontalBookCard.js +2 -2
  25. package/components/HorizontalBookCard.js.LICENSE.txt +1 -1
  26. package/components/HorizontalCard.js +2 -2
  27. package/components/HorizontalCard.js.LICENSE.txt +1 -1
  28. package/components/IconCard.js +2 -2
  29. package/components/IconCard.js.LICENSE.txt +1 -1
  30. package/components/Legend.js +1 -1
  31. package/components/Loader.js +1 -1
  32. package/components/MegaMenu.js +2 -2
  33. package/components/Notice.js +1 -1
  34. package/components/PageHeader.js +1 -1
  35. package/components/Pager.js +1 -1
  36. package/components/ProgressBar.js +1 -1
  37. package/components/QuoteHighlight.js +2 -2
  38. package/components/QuoteHighlight.js.LICENSE.txt +1 -1
  39. package/components/Radio.js +1 -1
  40. package/components/Range.js +1 -1
  41. package/components/ScrollContainer.js +2 -2
  42. package/components/SegmentedControl.js +1 -1
  43. package/components/Select.js +1 -1
  44. package/components/ServiceNotice.js +2 -2
  45. package/components/ShareButtons.js +2 -2
  46. package/components/ShowMore.js +1 -1
  47. package/components/SkipLink.js +1 -1
  48. package/components/StatsCard.js +2 -2
  49. package/components/StatsCard.js.LICENSE.txt +1 -1
  50. package/components/SyndicationSearchWidget.js +2 -2
  51. package/components/Tab.js +2 -2
  52. package/components/TextCta.js +2 -2
  53. package/components/TextCta.js.LICENSE.txt +1 -1
  54. package/components/TextInput.js +1 -1
  55. package/components/Textarea.js +1 -1
  56. package/components/Tree.js +1 -1
  57. package/components/UserFeedback.js +2 -2
  58. package/components/VerticalCard.js +2 -2
  59. package/components/VerticalCard.js.LICENSE.txt +1 -1
  60. package/components/hydrate.js +1 -1
  61. package/css/style-all.css +19 -14
  62. package/css/style-all.css.map +1 -1
  63. package/css/style-delta.css +19 -14
  64. package/css/style-delta.css.map +1 -1
  65. package/css/style-gutenberg.css +4 -8
  66. package/css/style-gutenberg.css.map +1 -1
  67. package/css/style-irp.css +19 -14
  68. package/css/style-irp.css.map +1 -1
  69. package/css/style-mcr.css +19 -14
  70. package/css/style-mcr.css.map +1 -1
  71. package/css/style-preventionweb.css +19 -14
  72. package/css/style-preventionweb.css.map +1 -1
  73. package/css/style.css +20 -14
  74. package/css/style.css.map +1 -1
  75. package/docs/EDITORIAL-MANUAL.md +1 -1
  76. package/docs/llms-page-building.txt +5 -3
  77. package/error-pages/401.html +1 -1
  78. package/error-pages/403.html +1 -1
  79. package/error-pages/404.html +1 -1
  80. package/error-pages/429.html +1 -1
  81. package/error-pages/500.html +1 -1
  82. package/error-pages/502.html +1 -1
  83. package/error-pages/503.html +1 -1
  84. package/error-pages/504.html +1 -1
  85. package/error-pages/5xx.html +1 -1
  86. package/error-pages/challenge.html +1 -1
  87. package/error-pages/managed-challenge.html +1 -1
  88. package/js/preview-access.js +180 -30
  89. package/package.json +1 -1
  90. package/scss/Atom/BaseTypography/Blockquote/blockquote.scss +2 -0
  91. package/scss/Atom/BaseTypography/Cite/cite.scss +2 -0
  92. package/scss/Atom/BaseTypography/Code/code.scss +2 -0
  93. package/scss/Atom/BaseTypography/Mark/mark.scss +2 -0
  94. package/scss/Atom/BaseTypography/Small/small.scss +2 -0
  95. package/scss/Atom/Icons/icons.scss +3 -2
  96. package/scss/Atom/Images/ImageCaptionCredit/image-caption-credit.scss +3 -0
  97. package/scss/Atom/Images/ImageCredit/image-credit.scss +2 -0
  98. package/scss/Atom/Layout/Container/container.scss +2 -0
  99. package/scss/Atom/Layout/Grid/grid.scss +2 -0
  100. package/scss/Atom/Logo/logo.scss +2 -0
  101. package/scss/Atom/Navigation/MenuItems/menu-items.scss +2 -0
  102. package/scss/Atom/ReachElement/Details/details.scss +3 -0
  103. package/scss/Atom/ReachElement/Figcaption/figcaption.scss +3 -0
  104. package/scss/Atom/StatusLabel/status-label.scss +2 -0
  105. package/scss/Atom/Table/table.scss +4 -0
  106. package/scss/Atom/Tag/tag.scss +3 -0
  107. package/scss/Components/Boilerplate/boilerplate.scss +3 -0
  108. package/scss/Components/Breadcrumbs/breadcrumbs.scss +2 -0
  109. package/scss/Components/Buttons/Chips/chips.scss +3 -0
  110. package/scss/Components/Buttons/CtaButton/buttons.scss +1 -1
  111. package/scss/Components/Buttons/CtaButton/cta-button.scss +4 -0
  112. package/scss/Components/Buttons/ShareButtons/share-buttons.scss +3 -0
  113. package/scss/Components/Cards/Card/card.scss +156 -3
  114. package/scss/Components/Cards/StatsCard/stats-card.scss +14 -2
  115. package/scss/Components/CiteThis/cite-this.scss +2 -0
  116. package/scss/Components/CookieConsentBanner/cookie-consent-banner.scss +2 -0
  117. package/scss/Components/DataViz/Legend/legend.scss +1 -0
  118. package/scss/Components/ErrorPages/error-pages.scss +2 -0
  119. package/scss/Components/Footer/footer.scss +2 -0
  120. package/scss/Components/Forms/FormAction/form-action.scss +2 -0
  121. package/scss/Components/Forms/FormGroup/form-group.scss +2 -0
  122. package/scss/Components/Forms/Range/range.scss +1 -0
  123. package/scss/Components/Forms/SegmentedControl/segmented-control.scss +2 -0
  124. package/scss/Components/Forms/Select/select.scss +2 -0
  125. package/scss/Components/Forms/_form-base.scss +3 -0
  126. package/scss/Components/Gallery/gallery.scss +4 -0
  127. package/scss/Components/Hero/hero.scss +3 -0
  128. package/scss/Components/HighlightBox/highlight-box.scss +3 -0
  129. package/scss/Components/MegaMenu/mega-menu.scss +60 -33
  130. package/scss/Components/MegaMenu/megamenu.scss +1 -1
  131. package/scss/Components/Navigation/Drawer/drawer.scss +1 -0
  132. package/scss/Components/Navigation/Tree/tree.scss +1 -0
  133. package/scss/Components/OnThisPageNav/on-this-page-nav.scss +3 -0
  134. package/scss/Components/PageHeader/page-header.scss +3 -0
  135. package/scss/Components/Pager/pager.scss +3 -0
  136. package/scss/Components/PreviewAccess/preview-access.scss +3 -0
  137. package/scss/Components/QuoteHighlight/quote-highlight.scss +2 -0
  138. package/scss/Components/ScrollContainer/scroll-container.scss +4 -0
  139. package/scss/Components/Snackbar/snackbar.scss +1 -0
  140. package/scss/Components/SyndicationSearchWidget/syndication-search-widget.scss +52 -1
  141. package/scss/Components/Tab/tab.scss +4 -0
  142. package/scss/Components/TableOfContents/table-of-contents.scss +2 -0
  143. package/scss/Components/TextCta/text-cta.scss +3 -0
  144. package/scss/Components/TextCta/textcta.scss +1 -1
  145. package/scss/Components/UserFeedback/user-feedback.scss +3 -0
  146. package/scss/Molecules/ImageCaption/image-caption.scss +2 -0
  147. package/scss/Molecules/SectionHeader/sectionheader.scss +1 -1
  148. package/scss/Patterns/ContentCard/content-card.scss +79 -0
  149. package/scss/Patterns/ContentTeaser/content-teaser.scss +174 -0
  150. package/scss/Patterns/HubHeader/hub-header.scss +3 -0
  151. package/scss/Patterns/RichContent/rich-content.scss +1 -0
  152. package/scss/Patterns/_shared/pattern-demo.scss +1 -1
  153. package/scss/Utilities/Loader/loader.scss +2 -0
  154. package/scss/Utilities/ShowMore/show-more.scss +2 -0
  155. package/scss/Utilities/SkipLink/skip-link.scss +2 -0
  156. package/scss/assets/fonts/noto-kufi-arabic/noto-kufi-arabic.scss +2 -0
  157. package/scss/assets/fonts/noto-sans-arabic/noto-sans-arabic.scss +2 -0
  158. package/scss/assets/fonts/roboto/roboto.scss +12 -12
  159. package/scss/assets/fonts/roboto/sass/_Black.scss +4 -0
  160. package/scss/assets/fonts/roboto/sass/_BlackItalic.scss +4 -0
  161. package/scss/assets/fonts/roboto/sass/_Bold.scss +4 -0
  162. package/scss/assets/fonts/roboto/sass/_BoldItalic.scss +4 -0
  163. package/scss/assets/fonts/roboto/sass/_Italic.scss +4 -0
  164. package/scss/assets/fonts/roboto/sass/_Light.scss +4 -0
  165. package/scss/assets/fonts/roboto/sass/_LightItalic.scss +4 -0
  166. package/scss/assets/fonts/roboto/sass/_Medium.scss +4 -0
  167. package/scss/assets/fonts/roboto/sass/_MediumItalic.scss +4 -0
  168. package/scss/assets/fonts/roboto/sass/_Regular.scss +4 -0
  169. package/scss/assets/fonts/roboto/sass/_variables.scss +1 -2
  170. package/scss/assets/fonts/roboto/sass/roboto.scss +12 -12
  171. package/scss/assets/fonts/roboto-condensed/roboto-condensed.scss +8 -8
  172. package/scss/assets/fonts/roboto-condensed/sass/_Bold.scss +4 -0
  173. package/scss/assets/fonts/roboto-condensed/sass/_BoldItalic.scss +4 -0
  174. package/scss/assets/fonts/roboto-condensed/sass/_Italic.scss +4 -0
  175. package/scss/assets/fonts/roboto-condensed/sass/_Light.scss +4 -0
  176. package/scss/assets/fonts/roboto-condensed/sass/_LightItalic.scss +4 -0
  177. package/scss/assets/fonts/roboto-condensed/sass/_Regular.scss +4 -0
  178. package/scss/assets/fonts/roboto-condensed/sass/_variables.scss +1 -1
  179. package/scss/assets/scss/_components.scss +79 -77
  180. package/scss/assets/scss/_config.scss +183 -0
  181. package/scss/assets/scss/_font-paths.scss +10 -0
  182. package/scss/assets/scss/_fonts.import.scss +2 -0
  183. package/scss/assets/scss/_fonts.scss +13 -55
  184. package/scss/assets/scss/_foundational.scss +6 -3
  185. package/scss/assets/scss/_legacy-warnings.scss +37 -0
  186. package/scss/assets/scss/_mixins.scss +2 -0
  187. package/scss/assets/scss/_style-all.import.scss +11 -0
  188. package/scss/assets/scss/_style-delta.import.scss +11 -0
  189. package/scss/assets/scss/_style-gutenberg.import.scss +11 -0
  190. package/scss/assets/scss/_style-irp.import.scss +11 -0
  191. package/scss/assets/scss/_style-mcr.import.scss +11 -0
  192. package/scss/assets/scss/_style-preventionweb.import.scss +11 -0
  193. package/scss/assets/scss/_style.import.scss +11 -0
  194. package/scss/assets/scss/_theme-delta.scss +2 -1
  195. package/scss/assets/scss/_theme-irp.scss +2 -1
  196. package/scss/assets/scss/_theme-mcr.scss +2 -1
  197. package/scss/assets/scss/_theme-preventionweb.scss +2 -1
  198. package/scss/assets/scss/_utility.scss +3 -0
  199. package/scss/assets/scss/_variables.import.scss +11 -0
  200. package/scss/assets/scss/_variables.scss +5 -230
  201. package/scss/assets/scss/generated/_tokens-mangrove.scss +87 -0
  202. package/scss/assets/scss/style-all.scss +14 -11
  203. package/scss/assets/scss/style-delta.scss +11 -8
  204. package/scss/assets/scss/style-gutenberg.scss +15 -12
  205. package/scss/assets/scss/style-irp.scss +11 -8
  206. package/scss/assets/scss/style-mcr.scss +11 -8
  207. package/scss/assets/scss/style-preventionweb.scss +11 -8
  208. package/scss/assets/scss/style.scss +10 -7
@@ -6,6 +6,9 @@
6
6
  * Full documentation:
7
7
  * https://github.com/PreventionWeb/undrr-mangrove/blob/main/stories/Components/Cards/Card/VerticalCard.mdx
8
8
  */
9
+ @use "../../../assets/scss/mixins" as *;
10
+ @use "../../../assets/scss/config" as *;
11
+
9
12
  /* content-card start */
10
13
 
11
14
  // MG CARD using CSS GRID
@@ -144,6 +147,12 @@
144
147
  }
145
148
 
146
149
  &__hc.mg-card-book__hc {
150
+ > .mg-card__content {
151
+ grid-column: 1 / -1;
152
+ grid-row: auto;
153
+ min-inline-size: 0;
154
+ }
155
+
147
156
  .mg-card__visual {
148
157
  align-self: flex-start;
149
158
  border: 1px solid rgb(var(--mg-color-neutral-600) / 0.2);
@@ -157,11 +166,16 @@
157
166
 
158
167
  &:has(.mg-card__visual) {
159
168
  grid-template-rows: unset;
160
- gap: 0 var(--mg-spacing-100);
169
+ gap: var(--mg-spacing-150);
161
170
 
162
171
  @media (min-width: $mg-breakpoint-mobile) {
163
- grid-template-columns: 160px 1fr;
164
- grid-template-rows: 1fr auto;
172
+ grid-template-columns: 160px minmax(0, 1fr);
173
+ grid-template-rows: auto;
174
+
175
+ > .mg-card__content {
176
+ grid-column: 2;
177
+ grid-row: 1;
178
+ }
165
179
  }
166
180
  }
167
181
  }
@@ -264,6 +278,85 @@
264
278
  }
265
279
  }
266
280
 
281
+ // Photo media forms the card edge; publication teasers preserve complete covers.
282
+ // Clip only the visual so content focus rings can extend beyond the surface.
283
+ .mg-card__vc:not(.mg-card__book),
284
+ .mg-card__hc:not(.mg-card-book__hc) {
285
+ padding: 0;
286
+ gap: 0;
287
+
288
+ > .mg-card__content {
289
+ min-inline-size: 0;
290
+ padding: var(--mg-card-padding);
291
+ }
292
+
293
+ > .mg-card__visual {
294
+ min-inline-size: 0;
295
+ border-radius: 0;
296
+ border-start-start-radius: var(--mg-card-border-radius);
297
+ border-start-end-radius: var(--mg-card-border-radius);
298
+ outline-offset: -1px;
299
+ }
300
+ }
301
+
302
+ .mg-card__vc:not(.mg-card__book):has(> .mg-card__visual) {
303
+ > .mg-card__content {
304
+ padding-block-start: calc(var(--mg-card-padding) + var(--mg-spacing-50));
305
+ }
306
+ }
307
+
308
+ .mg-card__hc:not(.mg-card-book__hc) {
309
+ grid-template-columns: minmax(0, 1fr);
310
+
311
+ > .mg-card__content {
312
+ grid-column: 1;
313
+ grid-row: auto;
314
+ }
315
+
316
+ &:has(> .mg-card__visual) {
317
+ grid-template-rows: 300px auto;
318
+
319
+ > .mg-card__content {
320
+ padding-block-start: calc(var(--mg-card-padding) + var(--mg-spacing-100));
321
+ }
322
+
323
+ @media (min-width: $mg-breakpoint-mobile) {
324
+ grid-template-columns: 160px minmax(0, 1fr);
325
+ grid-template-rows: auto;
326
+
327
+ > .mg-card__visual {
328
+ border-start-end-radius: 0;
329
+ border-end-start-radius: var(--mg-card-border-radius);
330
+ }
331
+
332
+ > .mg-card__content {
333
+ grid-column: 2;
334
+ padding-block-start: var(--mg-card-padding);
335
+ padding-inline-start: calc(
336
+ var(--mg-card-padding) + var(--mg-spacing-100)
337
+ );
338
+ }
339
+ }
340
+
341
+ @media (min-width: $mg-breakpoint-tablet) {
342
+ grid-template-columns: 330px minmax(0, 1fr);
343
+ }
344
+ }
345
+ }
346
+
347
+ // Without metadata, the title starts at the content inset. Do not stack the
348
+ // media gap and the title's label-separation padding above the first text.
349
+ .mg-card__vc:not(.mg-card__book),
350
+ .mg-card__hc:not(.mg-card-book__hc) {
351
+ > .mg-card__content:has(> .mg-card__title:first-child) {
352
+ padding-block-start: var(--mg-card-padding);
353
+
354
+ > .mg-card__title {
355
+ padding-block-start: 0;
356
+ }
357
+ }
358
+ }
359
+
267
360
  // RTL chevron — flip direction
268
361
  [dir="rtl"] .mg-card__title a::after {
269
362
  transform: rotate(225deg);
@@ -420,6 +513,61 @@ span.mg-card__label {
420
513
  }
421
514
  }
422
515
 
516
+ // Publication teasers: the cover is the object, without a second raised frame.
517
+ .mg-card.mg-card__book,
518
+ .mg-card.mg-card-book__hc {
519
+ background: var(--mg-card-publication-background);
520
+ padding: var(--mg-card-publication-padding);
521
+ border-radius: var(--mg-card-publication-border-radius);
522
+ box-shadow: var(--mg-card-publication-shadow);
523
+
524
+ &:hover {
525
+ box-shadow: var(--mg-card-publication-shadow-hover);
526
+ }
527
+
528
+ > .mg-card__visual {
529
+ aspect-ratio: auto;
530
+ border-radius: 0;
531
+ outline: none;
532
+ }
533
+
534
+ .mg-card__image {
535
+ block-size: auto;
536
+ object-fit: contain;
537
+ }
538
+
539
+ &:hover .mg-card__image {
540
+ opacity: 1;
541
+ transform: none;
542
+ }
543
+
544
+ .mg-card__title:first-child {
545
+ padding-block-start: 0;
546
+ }
547
+
548
+ &.mg-card--secondary {
549
+ padding-inline-start: var(--mg-card-padding);
550
+ }
551
+ }
552
+
553
+ // An unlinked teaser never advertises elevation on hover, including themed surfaces.
554
+ .mg-card.mg-card__book.mg-card--no-link:hover,
555
+ .mg-card.mg-card-book__hc.mg-card--no-link:hover,
556
+ .mg-card:is(.mg-card__book, .mg-card-book__hc):has(
557
+ .mg-card__title a:not([href])
558
+ ):hover,
559
+ .mg-card:is(.mg-card__book, .mg-card-book__hc):has(
560
+ .mg-card__title a[href=""]
561
+ ):hover {
562
+ box-shadow: var(--mg-card-publication-shadow);
563
+ }
564
+
565
+ .mg-card__book {
566
+ display: grid;
567
+ align-content: start;
568
+ gap: var(--mg-spacing-100);
569
+ }
570
+
423
571
  // END of CARD
424
572
 
425
573
  // Icon Card variant
@@ -481,6 +629,11 @@ span.mg-card__label {
481
629
  aspect-ratio: 1/1;
482
630
  }
483
631
 
632
+ // Small glyphs and fixed-size badges do not need the illustration frame.
633
+ &:has(.mg-card__icon-wrap--small) {
634
+ aspect-ratio: auto;
635
+ }
636
+
484
637
  // Fixed-size badges do not need the full illustration frame.
485
638
  &:has(.mg-card__icon-wrap--colored) {
486
639
  aspect-ratio: auto;
@@ -6,6 +6,9 @@
6
6
  * Full documentation:
7
7
  * https://github.com/PreventionWeb/undrr-mangrove/blob/main/stories/Components/Cards/StatsCard/StatsCard.mdx
8
8
  */
9
+ @use "../../../assets/scss/breakpoints" as *;
10
+ @use "../../../assets/scss/mixins" as *;
11
+
9
12
  /* Stats Card Component */
10
13
  .mg-stats-card {
11
14
  width: 100%;
@@ -142,10 +145,19 @@
142
145
  /* Variant: Compact */
143
146
  .mg-stats-card--compact {
144
147
  .mg-stats-card-item {
145
- padding: var(--mg-spacing-300);
148
+ padding: var(--mg-spacing-150);
149
+ gap: var(--mg-spacing-50);
146
150
 
147
151
  @include devicebreak(small) {
148
- padding: var(--mg-spacing-200);
152
+ padding: var(--mg-spacing-100);
153
+ }
154
+
155
+ // Compact spacing is owned by the gap, without child margins stacking up.
156
+ &__icon,
157
+ &__value,
158
+ &__bottom-label,
159
+ &__summary {
160
+ margin: 0;
149
161
  }
150
162
 
151
163
  &__value {
@@ -6,6 +6,8 @@
6
6
  * Full documentation:
7
7
  * https://github.com/PreventionWeb/undrr-mangrove/blob/main/stories/Components/CiteThis/CiteThis.mdx
8
8
  */
9
+ @use "../../assets/scss/mixins" as *;
10
+ @use "../../assets/scss/config" as *;
9
11
 
10
12
  .mg-cite-this {
11
13
  max-inline-size: 48rem;
@@ -6,6 +6,8 @@
6
6
  * Full documentation:
7
7
  * https://github.com/PreventionWeb/undrr-mangrove/blob/main/stories/Components/CookieConsentBanner/CookieConsentBanner.mdx
8
8
  */
9
+ @use "../../assets/scss/mixins" as *;
10
+
9
11
  // Mangrove theme bridge for the externally loaded vanilla-cookieconsent UI.
10
12
  // The CDN stylesheet is appended after the local bundle and declares the same
11
13
  // custom properties, so these token mappings intentionally carry importance.
@@ -6,6 +6,7 @@
6
6
  * Full documentation:
7
7
  * https://github.com/PreventionWeb/undrr-mangrove/blob/main/stories/Components/DataViz/Legend/Legend.mdx
8
8
  */
9
+ @use "../../../assets/scss/mixins" as *;
9
10
 
10
11
  .mg-legend {
11
12
  display: flex;
@@ -6,6 +6,8 @@
6
6
  * Full documentation:
7
7
  * https://github.com/PreventionWeb/undrr-mangrove/blob/main/stories/Components/ErrorPages/ErrorPage.mdx
8
8
  */
9
+ @use "../../assets/scss/config" as *;
10
+
9
11
  .mg-error-page {
10
12
  min-height: 100vh;
11
13
  background-color: rgb(var(--mg-color-blue-900));
@@ -6,6 +6,8 @@
6
6
  * Full documentation:
7
7
  * https://github.com/PreventionWeb/undrr-mangrove/blob/main/stories/Components/Footer/Footer.mdx
8
8
  */
9
+ @use "../../assets/scss/config" as *;
10
+
9
11
  .mg-footer {
10
12
  --mg-gutenberg-spacer: 0;
11
13
  }
@@ -6,6 +6,8 @@
6
6
  * Full documentation:
7
7
  * https://github.com/PreventionWeb/undrr-mangrove/blob/main/stories/Components/Forms/FormAction/FormAction.mdx
8
8
  */
9
+ @use "../../../assets/scss/config" as *;
10
+
9
11
  .mg-form-action {
10
12
  align-items: stretch;
11
13
  display: flex;
@@ -6,6 +6,8 @@
6
6
  * Full documentation:
7
7
  * https://github.com/PreventionWeb/undrr-mangrove/blob/main/stories/Components/Forms/FormGroup/FormGroup.mdx
8
8
  */
9
+ @use "../../../assets/scss/mixins" as *;
10
+
9
11
  // FormGroup — styled fieldset/legend for grouping related form controls.
10
12
 
11
13
  .mg-form-group {
@@ -6,6 +6,7 @@
6
6
  * Full documentation:
7
7
  * https://github.com/PreventionWeb/undrr-mangrove/blob/main/stories/Components/Forms/Range/Range.mdx
8
8
  */
9
+ @use "../../../assets/scss/mixins" as *;
9
10
 
10
11
  @mixin mg-range-thumb {
11
12
  appearance: none;
@@ -8,6 +8,8 @@
8
8
  * Full documentation:
9
9
  * https://github.com/PreventionWeb/undrr-mangrove/blob/main/stories/Components/Forms/SegmentedControl/SegmentedControl.mdx
10
10
  */
11
+ @use "../../../assets/scss/mixins" as *;
12
+ @use "../../../assets/scss/config" as *;
11
13
 
12
14
  // The control is a presentation layer over a native radio group: a fieldset, a
13
15
  // legend and one <input type="radio"> per segment, each followed by its own
@@ -6,6 +6,8 @@
6
6
  * Full documentation:
7
7
  * https://github.com/PreventionWeb/undrr-mangrove/blob/main/stories/Components/Forms/Select/Select.mdx
8
8
  */
9
+ @use "../../../assets/scss/config" as *;
10
+
9
11
  // Select-specific overrides.
10
12
  // Shared form styles live in _form-base.scss (.mg-form-select).
11
13
 
@@ -6,6 +6,9 @@
6
6
  * Full documentation:
7
7
  * https://github.com/PreventionWeb/undrr-mangrove/blob/main/stories/Components/Forms/TextInput/TextInput.mdx
8
8
  */
9
+ @use "../../assets/scss/mixins" as *;
10
+ @use "../../assets/scss/config" as *;
11
+
9
12
  // Shared BEM-scoped form styles for Mangrove form components.
10
13
  // All form components import this partial for consistent base styling.
11
14
 
@@ -6,6 +6,10 @@
6
6
  * Full documentation:
7
7
  * https://github.com/PreventionWeb/undrr-mangrove/blob/main/stories/Components/Gallery/Gallery.mdx
8
8
  */
9
+ @use "../../assets/scss/breakpoints" as *;
10
+ @use "../../assets/scss/mixins" as *;
11
+ @use "../../assets/scss/config" as *;
12
+
9
13
  /* Photo Gallery Component */
10
14
  .mg-gallery {
11
15
  position: relative;
@@ -6,6 +6,9 @@
6
6
  * Full documentation:
7
7
  * https://github.com/PreventionWeb/undrr-mangrove/blob/main/stories/Components/Hero/Hero.mdx
8
8
  */
9
+ @use "../../assets/scss/mixins" as *;
10
+ @use "../../assets/scss/config" as *;
11
+
9
12
  // The veil between the photograph and the copy, in two layers.
10
13
 
11
14
  // The lower layer is the brand tint that has always been here: the hero
@@ -6,6 +6,9 @@
6
6
  * Full documentation:
7
7
  * https://github.com/PreventionWeb/undrr-mangrove/blob/main/stories/Components/HighlightBox/HighlightBox.mdx
8
8
  */
9
+ @use "../../assets/scss/breakpoints" as *;
10
+ @use "../../assets/scss/config" as *;
11
+
9
12
  // Highlight box component (RTL-safe)
10
13
  // https://gitlab.com/undrr/web-backlog/-/issues/1678
11
14
  // Variables and mixins are imported at the theme level via @use in mangrove.scss
@@ -6,10 +6,15 @@
6
6
  * Full documentation:
7
7
  * https://github.com/PreventionWeb/undrr-mangrove/blob/main/stories/Components/MegaMenu/MegaMenu.mdx
8
8
  */
9
+ @use "../../assets/scss/mixins" as *;
10
+ @use "../../assets/scss/config" as *;
11
+
9
12
  .mg-mega-wrapper {
10
13
  position: relative;
11
14
  background: rgb(var(--mg-color-white));
12
- box-shadow: inset 0 -1px 0 rgb(var(--mg-color-neutral-600) / 0.24);
15
+
16
+ // Paint below the header so opaque logo/trigger surfaces cannot cover it.
17
+ box-shadow: 0 1px 0 rgb(var(--mg-color-neutral-600) / 0.24);
13
18
  z-index: var(--mg-z-index-nav);
14
19
  }
15
20
 
@@ -19,9 +24,7 @@
19
24
  align-items: flex-start;
20
25
  z-index: var(--mg-z-index-nav);
21
26
 
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.
27
+ // Plain HTML consumers can use this class directly on a navigation list.
25
28
  @include mg-list-unmarked;
26
29
 
27
30
  padding: 0;
@@ -33,17 +36,38 @@
33
36
  }
34
37
 
35
38
  // Kept max-width based to avoid a Firefox glitch with .mg-container-full-width.
36
- @media screen and (max-width: $mg-breakpoint-tablet) {
37
- padding-left: mg-rem(40); // space for the icon button
38
- overflow-x: hidden; // primarily for mobile
39
+ @media screen and (width < $mg-breakpoint-tablet) {
40
+ position: relative;
41
+ padding-inline-start: mg-rem(40); // space for the icon button
42
+ overflow-x: auto;
43
+ overscroll-behavior-inline: contain;
44
+ scrollbar-width: none;
45
+ }
46
+
47
+ // React keeps the hamburger outside the scrolling rail in both variants.
48
+ // Avoid sticky flex children: WebKit can scroll them out of view in RTL.
49
+ @media screen and (width < $mg-breakpoint-tablet) {
50
+ &:has(> .mg-mega-topbar__nav) {
51
+ padding-inline-start: 0;
52
+ overflow: hidden;
53
+ }
54
+
55
+ > .mg-mega-topbar-mobile__icon-button {
56
+ position: relative;
57
+ inset: auto;
58
+ width: mg-rem(40);
59
+ flex-shrink: 0;
60
+ align-self: stretch;
61
+ background: rgb(var(--mg-color-white));
62
+ }
39
63
  }
40
64
 
41
65
  // --- Branded variant (with inline logo) ---
42
66
  &--branded {
43
67
  align-items: center;
44
68
 
45
- @media screen and (max-width: $mg-breakpoint-tablet) {
46
- padding-left: 0; // logo replaces the left padding
69
+ @media screen and (width < $mg-breakpoint-tablet) {
70
+ padding-inline-start: 0; // logo replaces the left padding
47
71
  overflow-x: hidden;
48
72
  }
49
73
 
@@ -69,6 +93,10 @@
69
93
  justify-content: flex-end;
70
94
  flex: 1;
71
95
 
96
+ @media screen and (width < $mg-breakpoint-tablet) {
97
+ justify-content: flex-start;
98
+ }
99
+
72
100
  @include mg-list-unmarked;
73
101
 
74
102
  margin: 0;
@@ -106,11 +134,23 @@
106
134
 
107
135
  @include mg-list-unmarked;
108
136
 
109
- // Clip overflow on mobile so the scrolling content hint works correctly.
110
- // pointer-events is left as auto here — it is restricted only when JS has
111
- // initialised the full mega menu (see .mg-mega-wrapper--js-active below).
112
- @media screen and (max-width: $mg-breakpoint-tablet) {
113
- overflow: hidden;
137
+ // The branded rail scrolls independently of the logo and hamburger.
138
+ @media screen and (width < $mg-breakpoint-tablet) {
139
+ overflow-x: auto;
140
+ overscroll-behavior-inline: contain;
141
+ scrollbar-width: none;
142
+ cursor: grab;
143
+ user-select: none;
144
+
145
+ &:active {
146
+ cursor: grabbing;
147
+ }
148
+
149
+ .mg-mega-topbar__item-link {
150
+ cursor: inherit;
151
+ }
152
+
153
+ justify-content: flex-start;
114
154
  flex: 1;
115
155
  min-width: 0;
116
156
  }
@@ -145,6 +185,7 @@
145
185
  }
146
186
  }
147
187
 
188
+ flex-shrink: 0;
148
189
  font-size: var(--mg-font-size-300);
149
190
  color: rgb(var(--mg-color-interactive));
150
191
  font-weight: bold;
@@ -685,6 +726,7 @@
685
726
  .mg-mega-topbar-mobile__icon-button {
686
727
  // Mobile-first: Display by default
687
728
  position: absolute;
729
+ inset-block: 0;
688
730
 
689
731
  // Anchored to both edges of the topbar rather than assumed to be
690
732
  // viewport-wide: a `100vw` overlay overhangs and is clipped by the parent's
@@ -698,7 +740,8 @@
698
740
  color: rgb(var(--mg-color-interactive));
699
741
  font-size: mg-rem(20);
700
742
  width: auto;
701
- height: 100%;
743
+ height: auto;
744
+ min-height: mg-rem(44);
702
745
  padding: var(--mg-spacing-100);
703
746
  border: none;
704
747
  cursor: pointer;
@@ -790,24 +833,8 @@
790
833
  box-shadow: 3px 0 6px -2px rgb(0 0 0 / 0.15);
791
834
  }
792
835
 
793
- // Full JS mega menu — sidebar handles mobile nav, so topbar items must NOT be
794
- // interactive on small screens. This class is added by the React component on
795
- // mount (useEffect), so it is absent when JS fails or has not yet hydrated,
796
- // preserving a clickable fallback for server-rendered nav markup.
797
- .mg-mega-wrapper--js-active {
798
- @media screen and (max-width: $mg-breakpoint-tablet) {
799
- .mg-mega-topbar__nav {
800
- pointer-events: none;
801
- }
802
-
803
- .mg-mega-topbar__item {
804
- pointer-events: none;
805
- }
806
- }
807
- }
808
-
809
836
  // Mobile progressive navigation: one stable surface at every depth. Existing
810
- // desktop classes and the full-strip opening target remain compatible.
837
+ // desktop classes remain compatible; the rail opens individual sections.
811
838
  .mg-mega-mobile-sidebar--progressive {
812
839
  position: fixed;
813
840
  inset: 0 0 auto;
@@ -1091,7 +1118,7 @@
1091
1118
 
1092
1119
  // Existing plain HTML navigation needs no hamburger gutter or JS enhancement.
1093
1120
  // Keep overflow local to the rail so every destination remains reachable.
1094
- @media screen and (max-width: $mg-breakpoint-tablet) {
1121
+ @media screen and (width < $mg-breakpoint-tablet) {
1095
1122
  .mg-mega-topbar:not(
1096
1123
  .mg-mega-topbar--branded,
1097
1124
  :has(.mg-mega-topbar-mobile__icon-button)
@@ -7,5 +7,5 @@
7
7
  * https://github.com/PreventionWeb/undrr-mangrove/blob/main/stories/Components/MegaMenu/MegaMenu.mdx
8
8
  */
9
9
  // megamenu.scss — DEPRECATED, use mega-menu.scss
10
- @import "./mega-menu";
10
+ @forward "./mega-menu";
11
11
  @warn "megamenu.scss is deprecated. Import mega-menu.scss instead.";
@@ -7,6 +7,7 @@
7
7
  * Full documentation:
8
8
  * https://github.com/PreventionWeb/undrr-mangrove/blob/main/stories/Components/Navigation/Drawer/Drawer.mdx
9
9
  */
10
+ @use "../../../assets/scss/config" as *;
10
11
 
11
12
  .mg-drawer,
12
13
  .mg-floating-panel {
@@ -6,6 +6,7 @@
6
6
  * Full documentation:
7
7
  * https://github.com/PreventionWeb/undrr-mangrove/blob/main/stories/Components/Navigation/Tree/Tree.mdx
8
8
  */
9
+ @use "../../../assets/scss/mixins" as *;
9
10
 
10
11
  .mg-tree {
11
12
  // The selected label uses the text colour, not the interactive colour: IRP's
@@ -6,6 +6,9 @@
6
6
  * Full documentation:
7
7
  * https://github.com/PreventionWeb/undrr-mangrove/blob/main/stories/Components/OnThisPageNav/OnThisPageNav.mdx
8
8
  */
9
+ @use "../../assets/scss/mixins" as *;
10
+ @use "../../assets/scss/config" as *;
11
+
9
12
  // On this page nav
10
13
  // https://gitlab.com/undrr/web-backlog/-/issues/337
11
14
  // A sticky horizontal navigation bar that links to page sections.
@@ -6,6 +6,9 @@
6
6
  * Full documentation:
7
7
  * https://github.com/PreventionWeb/undrr-mangrove/blob/main/stories/Components/PageHeader/PageHeader.mdx
8
8
  */
9
+ @use "../../assets/scss/mixins" as *;
10
+ @use "../../assets/scss/config" as *;
11
+
9
12
  .mg-page-header {
10
13
  // Base styles for page header
11
14
 
@@ -6,6 +6,9 @@
6
6
  * Full documentation:
7
7
  * https://github.com/PreventionWeb/undrr-mangrove/blob/main/stories/Components/Pager/Pager.mdx
8
8
  */
9
+ @use "../../assets/scss/mixins" as *;
10
+ @use "../../assets/scss/config" as *;
11
+
9
12
  // ========================================
10
13
  // Pager — standalone pagination component
11
14
  // ========================================
@@ -6,6 +6,9 @@
6
6
  * Full documentation:
7
7
  * https://github.com/PreventionWeb/undrr-mangrove/blob/main/stories/Components/PreviewAccess/PreviewAccess.mdx
8
8
  */
9
+ @use "../../assets/scss/mixins" as *;
10
+ @use "../../assets/scss/config" as *;
11
+
9
12
  // Preview access
10
13
  // Soft preview gate for unfinished UNDRR pages. CSS hides the page on parse
11
14
  // (via :has()); the runtime layers a modal over it and asks for a PIN.
@@ -6,6 +6,8 @@
6
6
  * Full documentation:
7
7
  * https://github.com/PreventionWeb/undrr-mangrove/blob/main/stories/Components/QuoteHighlight/QuoteHighlight.mdx
8
8
  */
9
+ @use "../../assets/scss/breakpoints" as *;
10
+
9
11
  .mg-quote-highlight {
10
12
  display: flex;
11
13
  flex-direction: column;
@@ -6,6 +6,10 @@
6
6
  * Full documentation:
7
7
  * https://github.com/PreventionWeb/undrr-mangrove/blob/main/stories/Components/ScrollContainer/ScrollContainer.mdx
8
8
  */
9
+ @use "../../assets/scss/breakpoints" as *;
10
+ @use "../../assets/scss/mixins" as *;
11
+ @use "../../assets/scss/config" as *;
12
+
9
13
  .mg-scroll {
10
14
  position: relative;
11
15
  display: flex;
@@ -7,6 +7,7 @@
7
7
  * Full documentation:
8
8
  * https://github.com/PreventionWeb/undrr-mangrove/blob/main/stories/Components/Snackbar/Snackbar.mdx
9
9
  */
10
+ @use "../../assets/scss/config" as *;
10
11
 
11
12
  .mg-snackbar-wrapper {
12
13
  position: fixed;