@defra/docusaurus-theme-govuk 0.0.18-alpha → 0.0.20-alpha

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra/docusaurus-theme-govuk",
3
- "version": "0.0.18-alpha",
3
+ "version": "0.0.20-alpha",
4
4
  "description": "A Docusaurus theme implementing the GOV.UK Design System for consistent, accessible documentation sites",
5
5
  "main": "index.js",
6
6
  "license": "MIT",
@@ -5,6 +5,7 @@
5
5
  .app-layout-sidebar {
6
6
  display: flex;
7
7
  gap: 2rem;
8
+ width: 100%;
8
9
  }
9
10
 
10
11
  .app-layout-sidebar__nav {
@@ -26,6 +27,7 @@
26
27
  overflow: auto !important;
27
28
  margin-left: -16px;
28
29
  padding-left: 16px;
30
+ margin-top: govuk-spacing(1) * -1;
29
31
  }
30
32
  }
31
33
 
@@ -153,19 +155,25 @@
153
155
  border-bottom: 1px solid #cecece;
154
156
 
155
157
  position: relative;
156
- padding-top: 5px;
157
- padding-bottom: 5px;
158
- margin-bottom: 5px;
159
- font-size: 1rem;
158
+ padding-top: govuk-spacing(2);
159
+ padding-bottom: govuk-spacing(2);
160
+ margin-bottom: 0;
161
+
162
+ font-size: 1.1875rem;
160
163
  padding-left: 0;
161
164
  margin-left: 0;
162
-
165
+
163
166
  @media (min-width: 48.125em) {
167
+ font-size: 1rem;
168
+ padding-top: govuk-spacing(1);
169
+ padding-bottom: govuk-spacing(1);
170
+ margin-bottom: govuk-spacing(1);
164
171
  border-bottom: 0;
165
172
 
166
173
  &:after {
167
174
  border-bottom: 0;
168
175
  }
176
+
169
177
  }
170
178
 
171
179
  .not-govuk-navigation-menu__list__link {
@@ -192,7 +200,7 @@
192
200
 
193
201
  .not-govuk-navigation-menu__list__item {
194
202
  padding: 5px 0;
195
- margin-bottom: 5px;
203
+ margin-bottom: 0;
196
204
  border-left-width: 0px;
197
205
  border-left-style: solid;
198
206
  }
@@ -299,6 +307,27 @@
299
307
  }
300
308
  }
301
309
 
310
+ // Lock service navigation to 1.1875rem on all devices, including mobile where
311
+ // govuk-font(19) would otherwise drop to 1rem. Parent selector raises
312
+ // specificity to (0,2,0) to beat the govuk-frontend mobile breakpoint rule.
313
+ .govuk-service-navigation .govuk-service-navigation__list,
314
+ .govuk-service-navigation .govuk-service-navigation__toggle,
315
+ .govuk-service-navigation .govuk-service-navigation__service-name {
316
+ font-size: 1.1875rem;
317
+ }
318
+
319
+ // Sidebar nav links and headings: 1.1875rem on mobile, 1rem on larger devices.
320
+ // Two-class specificity (0,2,0) beats the not-govuk `aside a` rule at (0,1,1).
321
+ .app-layout-sidebar__nav .not-govuk-navigation-menu__list__link,
322
+ .app-layout-sidebar__nav .not-govuk-navigation-menu__list__heading,
323
+ .app-layout-sidebar__nav .not-govuk-navigation-menu__list__heading-toggle {
324
+ font-size: 1.1875rem;
325
+
326
+ @media (min-width: 48.125em) {
327
+ font-size: 1rem;
328
+ }
329
+ }
330
+
302
331
  // Pagination
303
332
  .app-pagination__container {
304
333
  display: flex;
@@ -110,6 +110,21 @@
110
110
  }
111
111
  }
112
112
 
113
+ // Override GDS Transport on all prose elements. This must come after the
114
+ // @extend rules above (which bake in "GDS Transport" from govuk-frontend) so
115
+ // that cascade order wins at equal specificity. app-no-prose content is
116
+ // excluded so host apps can render GDS Transport there if licensed.
117
+ h1:not(.app-no-prose *),
118
+ h2:not(.app-no-prose *),
119
+ h3:not(.app-no-prose *),
120
+ h4:not(.app-no-prose *),
121
+ p:not(.app-no-prose *),
122
+ li:not(.app-no-prose *),
123
+ a:not(.app-no-prose *) {
124
+ font-family: Helvetica, Arial, sans-serif;
125
+ }
126
+
127
+
113
128
  // Code block copy button
114
129
  .app-code-block__copy {
115
130
  font-size: 0.9rem;
@@ -23,6 +23,14 @@ body,
23
23
  font-family: Helvetica, Arial, sans-serif;
24
24
  }
25
25
 
26
+ // Restore GDS Transport inside .app-no-prose containers (e.g. map examples in
27
+ // host apps that load the font separately and need the real GDS type stack).
28
+ .app-no-prose,
29
+ .app-no-prose [class^="govuk-"],
30
+ .app-no-prose [class*=" govuk-"] {
31
+ font-family: "GDS Transport", arial, sans-serif;
32
+ }
33
+
26
34
  /* Wider page width — overrides the 960px default from govuk-frontend.
27
35
  * !important is needed because @not-govuk/width-container injects its CSS
28
36
  * via the JS bundle, which loads after static stylesheets and wins the cascade.
@@ -62,10 +70,23 @@ body,
62
70
  }
63
71
 
64
72
  .govuk-template__body-inner > .govuk-width-container {
65
- flex: 1 0 auto;
66
73
  width: calc(100% - 30px);
67
74
  }
68
75
 
76
+ .govuk-template__body-inner > main {
77
+ flex: 1 0 auto;
78
+ display: flex;
79
+ flex-direction: column;
80
+
81
+ > *:last-child {
82
+ flex: 1;
83
+ }
84
+ }
85
+
86
+ .govuk-template__body-inner > .govuk-width-container:has(main) {
87
+ flex: 1 0 auto;
88
+ }
89
+
69
90
  @media (min-width: 40.0625em) {
70
91
  .govuk-template__body-inner > .govuk-width-container {
71
92
  width: calc(100% - 60px);
@@ -308,40 +308,53 @@ export default function Layout(props) {
308
308
  </div>
309
309
  )}
310
310
 
311
- {phaseBanner && (
311
+ {isHomepage ? (
312
+ <>
313
+ {phaseBanner && (
314
+ <div className="govuk-width-container">
315
+ <PhaseBanner phase={phaseBanner.phase}>
316
+ {phaseBanner.text}{' '}
317
+ {phaseBanner.feedbackHref && (
318
+ <a href={phaseBanner.feedbackHref} className="govuk-link">
319
+ feedback
320
+ </a>
321
+ )}
322
+ </PhaseBanner>
323
+ </div>
324
+ )}
325
+ <main id="main-content">
326
+ {children}
327
+ </main>
328
+ </>
329
+ ) : (
312
330
  <div className="govuk-width-container">
313
- <PhaseBanner phase={phaseBanner.phase}>
314
- {phaseBanner.text}{' '}
315
- {phaseBanner.feedbackHref && (
316
- <a href={phaseBanner.feedbackHref} className="govuk-link">
317
- feedback
318
- </a>
331
+ {phaseBanner && (
332
+ <PhaseBanner phase={phaseBanner.phase}>
333
+ {phaseBanner.text}{' '}
334
+ {phaseBanner.feedbackHref && (
335
+ <a href={phaseBanner.feedbackHref} className="govuk-link">
336
+ feedback
337
+ </a>
338
+ )}
339
+ </PhaseBanner>
340
+ )}
341
+ <main id="main-content" className="govuk-main-wrapper">
342
+ {sidebarItems ? (
343
+ <div className="app-layout-sidebar">
344
+ <aside className="app-layout-sidebar__nav">
345
+ <SidebarNav items={sidebarItems} />
346
+ </aside>
347
+ <div className="app-layout-sidebar__content">
348
+ {children}
349
+ </div>
350
+ </div>
351
+ ) : (
352
+ children
319
353
  )}
320
- </PhaseBanner>
354
+ </main>
321
355
  </div>
322
356
  )}
323
357
 
324
- <main id="main-content" className={isHomepage ? undefined : 'govuk-main-wrapper'}>
325
- {sidebarItems ? (
326
- <div className="govuk-width-container">
327
- <div className="app-layout-sidebar">
328
- <aside className="app-layout-sidebar__nav">
329
- <SidebarNav items={sidebarItems} />
330
- </aside>
331
- <div className="app-layout-sidebar__content">
332
- {children}
333
- </div>
334
- </div>
335
- </div>
336
- ) : isHomepage ? (
337
- children
338
- ) : (
339
- <div className="govuk-width-container">
340
- {children}
341
- </div>
342
- )}
343
- </main>
344
-
345
358
  {!noFooter && (
346
359
  <Footer rebrand meta={footer.meta} />
347
360
  )}