@defra/docusaurus-theme-govuk 0.0.20-alpha → 0.0.22-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/README.md +5 -1
- package/package.json +1 -1
- package/src/css/prose-scope.scss +3 -16
- package/src/css/theme.scss +14 -6
- package/src/theme/Heading/index.js +3 -3
package/README.md
CHANGED
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
A Docusaurus 3 theme that applies the [GOV.UK Design System](https://design-system.service.gov.uk/) to your documentation site.
|
|
4
4
|
|
|
5
|
+
## Intended use
|
|
6
|
+
|
|
7
|
+
This theme is intended for **developer documentation sites**, not public-facing government services. Certain GOV.UK assets are intentionally omitted or substituted for licensing reasons — for example, the crown logo is not included and GDS Transport is not bundled. See [Making your service look like GOV.UK](https://www.gov.uk/service-manual/design/making-your-service-look-like-govuk#if-your-service-isnt-on-govuk) for the relevant guidance.
|
|
8
|
+
|
|
5
9
|
## Features
|
|
6
10
|
|
|
7
|
-
- Full GOV.UK Design System shell: Header
|
|
11
|
+
- Full GOV.UK Design System shell: Header, Service Navigation, Phase Banner, Footer
|
|
8
12
|
- GOV.UK typography applied to all Markdown/MDX content via prose scoping
|
|
9
13
|
- Sidebar navigation driven by configuration (not Docusaurus's built-in sidebar UI)
|
|
10
14
|
- Syntax-highlighted code blocks with copy button
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defra/docusaurus-theme-govuk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22-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",
|
package/src/css/prose-scope.scss
CHANGED
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
.app-prose-scope {
|
|
6
6
|
// Headings
|
|
7
7
|
h1:not(.app-no-prose *) {
|
|
8
|
-
@extend %govuk-heading-
|
|
8
|
+
@extend %govuk-heading-l;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
h2:not(.app-no-prose *) {
|
|
12
|
-
@extend %govuk-heading-
|
|
12
|
+
@extend %govuk-heading-m;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
h3:not(.app-no-prose *) {
|
|
16
|
-
@extend %govuk-heading-
|
|
16
|
+
@extend %govuk-heading-s;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
h4:not(.app-no-prose *) {
|
|
@@ -110,19 +110,6 @@
|
|
|
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
113
|
|
|
127
114
|
|
|
128
115
|
// Code block copy button
|
package/src/css/theme.scss
CHANGED
|
@@ -11,16 +11,24 @@
|
|
|
11
11
|
@import 'govuk-frontend/dist/govuk/objects/grid';
|
|
12
12
|
|
|
13
13
|
/*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
14
|
+
* Font: Helvetica/Arial (not GDS Transport).
|
|
15
|
+
*
|
|
16
|
+
* GDS Transport is Crown Copyright and may only be used on gov.uk domains.
|
|
17
|
+
* This theme is designed for use on non-gov.uk domains (e.g. GitHub Pages),
|
|
18
|
+
* so Helvetica/Arial is used throughout as a visually similar alternative.
|
|
19
|
+
*
|
|
20
|
+
* !important is required for two reasons:
|
|
21
|
+
* 1. @not-govuk injects its own CSS via the JS bundle after static
|
|
22
|
+
* stylesheets load, which would otherwise win the cascade.
|
|
23
|
+
* 2. govuk-frontend mixins (e.g. govuk-font) bake GDS Transport directly
|
|
24
|
+
* into compiled output; !important ensures those are always overridden.
|
|
19
25
|
*/
|
|
20
26
|
body,
|
|
27
|
+
h1, h2, h3, h4, h5, h6,
|
|
28
|
+
p, li, a, span:not(pre *):not(code *), label, legend, dt, dd, caption, summary,
|
|
21
29
|
[class^="govuk-"],
|
|
22
30
|
[class*=" govuk-"] {
|
|
23
|
-
font-family: Helvetica, Arial, sans-serif;
|
|
31
|
+
font-family: Helvetica, Arial, sans-serif !important;
|
|
24
32
|
}
|
|
25
33
|
|
|
26
34
|
// Restore GDS Transport inside .app-no-prose containers (e.g. map examples in
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
const headingClasses = {
|
|
4
|
-
h1: 'govuk-heading-
|
|
5
|
-
h2: 'govuk-heading-
|
|
6
|
-
h3: 'govuk-heading-
|
|
4
|
+
h1: 'govuk-heading-l',
|
|
5
|
+
h2: 'govuk-heading-m',
|
|
6
|
+
h3: 'govuk-heading-s',
|
|
7
7
|
h4: 'govuk-heading-s',
|
|
8
8
|
h5: 'govuk-heading-s',
|
|
9
9
|
h6: 'govuk-heading-s',
|