govuk_tech_docs 6.0.1 → 6.2.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.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/bug.yaml +69 -0
- data/.github/ISSUE_TEMPLATE/config.yaml +6 -0
- data/.github/ISSUE_TEMPLATE/enhancement.yaml +25 -0
- data/.github/pull_request_template.md +22 -8
- data/.github/workflows/dependency-review.yaml +17 -0
- data/.github/workflows/test.yaml +1 -1
- data/.nvmrc +1 -1
- data/.ruby-version +1 -1
- data/CHANGELOG.md +18 -2
- data/README.md +3 -2
- data/example/.ruby-version +1 -1
- data/example/config/tech-docs.yml +4 -0
- data/example/config.rb +15 -0
- data/example/source/active-pages/index.html.md.erb +7 -0
- data/example/source/active-pages/sub-section/index.html.md.erb +7 -0
- data/example/source/index.html.md.erb +6 -1
- data/govuk_tech_docs.gemspec +21 -19
- data/lib/govuk_tech_docs/custom_method_missing_handler.rb +30 -0
- data/lib/govuk_tech_docs/govuk_nunjuck_componenet_renderer.rb +43 -0
- data/lib/govuk_tech_docs/version.rb +1 -1
- data/lib/govuk_tech_docs.rb +35 -5
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +1 -1
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +1 -1
- data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/_accordion.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/_back-link.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/_index.scss +7 -3
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_breadcrumbs.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_index.scss +8 -4
- data/node_modules/govuk-frontend/dist/govuk/components/button/_button.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/button/_index.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/_character-count.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_checkboxes.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_index.scss +10 -6
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_cookie-banner.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/_date-input.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/details/_details.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/details/_index.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/_error-message.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_error-summary.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_index.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_exit-this-page.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_index.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_fieldset.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_index.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_file-upload.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_footer.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/_header.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/hint/_hint.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/hint/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/_input.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_index.scss +5 -1
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_inset-text.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/label/_index.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/label/_label.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss +6 -2
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_notification-banner.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/_pagination.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/panel/_panel.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/_password-input.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_phase-banner.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss +14 -10
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_radios.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/_select.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss +5 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_service-navigation.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss +7 -3
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_skip-link.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss +15 -2
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_summary-list.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/table/_index.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/table/_table.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/_index.scss +5 -2
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/_tabs.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tag/_tag.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/_index.scss +6 -2
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/_task-list.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/_textarea.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_warning-text.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/core/_global-styles.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_index.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_links.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_lists.scss +10 -1
- data/node_modules/govuk-frontend/dist/govuk/core/_section-break.scss +5 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_typography.scss +14 -13
- data/node_modules/govuk-frontend/dist/govuk/custom-properties/_frontend-version.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/custom-properties/_functional-colours.scss +5 -0
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss +38 -70
- data/node_modules/govuk-frontend/dist/govuk/helpers/_device-pixels.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.scss +3 -2
- data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss +4 -4
- data/node_modules/govuk-frontend/dist/govuk/helpers/_media-queries.scss +17 -15
- data/node_modules/govuk-frontend/dist/govuk/helpers/_shape-arrow.scss +2 -2
- data/node_modules/govuk-frontend/dist/govuk/helpers/_spacing.scss +19 -13
- data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss +48 -26
- data/node_modules/govuk-frontend/dist/govuk/helpers/_visually-hidden.scss +13 -11
- data/node_modules/govuk-frontend/dist/govuk/objects/_grid.scss +4 -2
- data/node_modules/govuk-frontend/dist/govuk/objects/_width-container.scss +10 -9
- data/node_modules/govuk-frontend/dist/govuk/overrides/_display.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_index.scss +3 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_spacing.scss +5 -1
- data/node_modules/govuk-frontend/dist/govuk/overrides/_text-align.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.scss +7 -2
- data/node_modules/govuk-frontend/dist/govuk/overrides/_width.scss +3 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_assets.scss +18 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-functional.scss +28 -4
- data/node_modules/govuk-frontend/dist/govuk/settings/_links.scss +3 -2
- data/node_modules/govuk-frontend/dist/govuk/settings/_measurements.scss +8 -16
- data/node_modules/govuk-frontend/dist/govuk/settings/_typography-font.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_warnings.scss +15 -2
- data/node_modules/govuk-frontend/dist/govuk/tools/_exports.scss +3 -2
- data/node_modules/govuk-frontend/dist/govuk/tools/_font-url.scss +13 -5
- data/node_modules/govuk-frontend/dist/govuk/tools/_if.scss +24 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_image-url.scss +13 -5
- data/node_modules/govuk-frontend/dist/govuk/tools/_index.scss +1 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss +5 -3
- data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-rem.scss +4 -2
- data/node_modules/govuk-frontend/dist/govuk/utilities/_clearfix.scss +3 -0
- data/node_modules/govuk-frontend/dist/govuk/utilities/_index.scss +1 -0
- data/node_modules/govuk-frontend/dist/govuk/utilities/_visually-hidden.scss +3 -0
- data/node_modules/govuk-frontend/dist/govuk-prototype-kit/init.scss +3 -1
- data/package-lock.json +1302 -4959
- data/package.json +5 -4
- metadata +74 -80
- data/.github/ISSUE_TEMPLATE.md +0 -13
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
////
|
|
2
2
|
/// @group settings/warnings
|
|
3
3
|
////
|
|
4
|
+
@use "sass:list";
|
|
4
5
|
|
|
5
6
|
/// Suppressed warnings map
|
|
6
7
|
///
|
|
@@ -51,18 +52,30 @@ $govuk-suppressed-warnings: () !default;
|
|
|
51
52
|
@warn _warning-text($key, $message);
|
|
52
53
|
|
|
53
54
|
@if $silence-further-warnings {
|
|
54
|
-
$govuk-suppressed-warnings: append($govuk-suppressed-warnings, $key) !global;
|
|
55
|
+
$govuk-suppressed-warnings: list.append($govuk-suppressed-warnings, $key) !global;
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
|
|
60
|
+
/// Logs a deprecation warning that the given component's `<COMPONENT_NAME>.scss` file is deprecated
|
|
61
|
+
///
|
|
62
|
+
/// @param {string} $component-name - The name of component, as it appears in the folder gathering its files
|
|
63
|
+
/// @access private
|
|
64
|
+
@mixin _component-scss-file-warning($component-name) {
|
|
65
|
+
$component-path: "<PATH_TO_GOVUK_FRONTEND>/components/#{$component-name}";
|
|
66
|
+
|
|
67
|
+
$message: "Importing `#{$component-path}/#{$component-name}` is deprecated." + " Import `#{$component-path}` instead.";
|
|
68
|
+
|
|
69
|
+
@include _warning("component-scss-files", $message, $silence-further-warnings: false);
|
|
70
|
+
}
|
|
71
|
+
|
|
59
72
|
/// Check whether a key is present in the suppressed warnings list.
|
|
60
73
|
///
|
|
61
74
|
/// @param {String} $key - The key to be checked against `$govuk-suppressed-warnings`.
|
|
62
75
|
/// @access private
|
|
63
76
|
|
|
64
77
|
@function _should-warn($key) {
|
|
65
|
-
@return index($govuk-suppressed-warnings, $key) == null;
|
|
78
|
+
@return list.index($govuk-suppressed-warnings, $key) == null;
|
|
66
79
|
}
|
|
67
80
|
|
|
68
81
|
/// Format a warning by appending information on how to suppress it.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
////
|
|
2
2
|
/// @group tools
|
|
3
3
|
////
|
|
4
|
+
@use "sass:list";
|
|
4
5
|
|
|
5
6
|
/// List of modules which have already been exported
|
|
6
7
|
///
|
|
@@ -22,9 +23,9 @@ $_govuk-imported-modules: () !default;
|
|
|
22
23
|
|
|
23
24
|
@mixin govuk-exports($name) {
|
|
24
25
|
// If the mixin is not in the list of modules already exported...
|
|
25
|
-
@if not index($_govuk-imported-modules, $name) {
|
|
26
|
+
@if not list.index($_govuk-imported-modules, $name) {
|
|
26
27
|
// ... then add it to the list
|
|
27
|
-
$_govuk-imported-modules: append($_govuk-imported-modules, $name) !global;
|
|
28
|
+
$_govuk-imported-modules: list.append($_govuk-imported-modules, $name) !global;
|
|
28
29
|
// ... and output the CSS for that module
|
|
29
30
|
@content;
|
|
30
31
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
////
|
|
2
2
|
/// @group tools/assets
|
|
3
3
|
////
|
|
4
|
+
@use "sass:meta";
|
|
4
5
|
|
|
5
6
|
/// Font URL
|
|
6
7
|
///
|
|
@@ -14,12 +15,19 @@
|
|
|
14
15
|
|
|
15
16
|
@function govuk-font-url($filename) {
|
|
16
17
|
// prettier-ignore
|
|
17
|
-
$
|
|
18
|
-
and $govuk-font-url-function
|
|
19
|
-
and function-exists($govuk-font-url-function);
|
|
18
|
+
$custom-function: meta.variable-exists("govuk-font-url-function")
|
|
19
|
+
and $govuk-font-url-function;
|
|
20
20
|
|
|
21
|
-
@if $
|
|
22
|
-
@
|
|
21
|
+
@if meta.type-of($custom-function) == "string" {
|
|
22
|
+
@if meta.function-exists($custom-function) {
|
|
23
|
+
$custom-function: meta.get-function($custom-function);
|
|
24
|
+
} @else {
|
|
25
|
+
$custom-function: null;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@if $custom-function {
|
|
30
|
+
@return meta.call($custom-function, $filename);
|
|
23
31
|
} @else {
|
|
24
32
|
@return url($govuk-fonts-path + $filename);
|
|
25
33
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
////
|
|
2
|
+
/// @group tools/if
|
|
3
|
+
////
|
|
4
|
+
|
|
5
|
+
/// Inline `if` function
|
|
6
|
+
///
|
|
7
|
+
/// Replicates the syntax of the original Sass `if` function
|
|
8
|
+
/// to support Sass `>=1.79 <1.95`. Defaults `$if-false` to `null`
|
|
9
|
+
/// when not set.
|
|
10
|
+
///
|
|
11
|
+
/// @param {Boolean} $condition - The condition
|
|
12
|
+
/// @param {any} $if-true - The value if the condition is met
|
|
13
|
+
/// @param {any} $if-false [null] - The value if the condition is not met, defaults to `null`.
|
|
14
|
+
/// @returns {any} `$if-true` if the condition is met, `$if-false` otherwise.
|
|
15
|
+
/// @access public
|
|
16
|
+
@function govuk-if($condition, $if-true, $if-false: null) {
|
|
17
|
+
@if $condition {
|
|
18
|
+
@return $if-true;
|
|
19
|
+
} @else {
|
|
20
|
+
@return $if-false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/*# sourceMappingURL=_if.scss.map */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
////
|
|
2
2
|
/// @group tools/assets
|
|
3
3
|
////
|
|
4
|
+
@use "sass:meta";
|
|
4
5
|
|
|
5
6
|
/// Image URL
|
|
6
7
|
///
|
|
@@ -14,12 +15,19 @@
|
|
|
14
15
|
|
|
15
16
|
@function govuk-image-url($filename) {
|
|
16
17
|
// prettier-ignore
|
|
17
|
-
$
|
|
18
|
-
and $govuk-image-url-function
|
|
19
|
-
and function-exists($govuk-image-url-function);
|
|
18
|
+
$custom-function: meta.variable-exists("govuk-image-url-function")
|
|
19
|
+
and $govuk-image-url-function;
|
|
20
20
|
|
|
21
|
-
@if $
|
|
22
|
-
@
|
|
21
|
+
@if meta.type-of($custom-function) == "string" {
|
|
22
|
+
@if meta.function-exists($custom-function) {
|
|
23
|
+
$custom-function: meta.get-function($custom-function);
|
|
24
|
+
} @else {
|
|
25
|
+
$custom-function: null;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@if $custom-function {
|
|
30
|
+
@return meta.call($custom-function, $filename);
|
|
23
31
|
} @else {
|
|
24
32
|
@return url($govuk-images-path + $filename);
|
|
25
33
|
}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
/// @group tools/unit-conversion
|
|
3
3
|
////
|
|
4
4
|
|
|
5
|
+
@use "sass:math";
|
|
6
|
+
|
|
5
7
|
@import "../settings/typography-responsive";
|
|
6
8
|
|
|
7
9
|
/// Convert pixels to em
|
|
@@ -12,13 +14,13 @@
|
|
|
12
14
|
/// @access public
|
|
13
15
|
|
|
14
16
|
@function govuk-em($value, $context-font-size: $govuk-root-font-size) {
|
|
15
|
-
@if unitless($value) {
|
|
17
|
+
@if math.is-unitless($value) {
|
|
16
18
|
$value: $value * 1px;
|
|
17
19
|
}
|
|
18
|
-
@if unitless($context-font-size) {
|
|
20
|
+
@if math.is-unitless($context-font-size) {
|
|
19
21
|
$context-font-size: $context-font-size * 1px;
|
|
20
22
|
}
|
|
21
|
-
@return $value
|
|
23
|
+
@return math.div($value, $context-font-size) * 1em;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
/*# sourceMappingURL=_px-to-em.scss.map */
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
/// @group tools/unit-conversion
|
|
3
3
|
////
|
|
4
4
|
|
|
5
|
+
@use "sass:math";
|
|
6
|
+
|
|
5
7
|
@import "../settings/typography-responsive";
|
|
6
8
|
|
|
7
9
|
/// Convert pixels to rem
|
|
@@ -14,11 +16,11 @@
|
|
|
14
16
|
/// @access public
|
|
15
17
|
|
|
16
18
|
@function govuk-px-to-rem($value) {
|
|
17
|
-
@if unitless($value) {
|
|
19
|
+
@if math.is-unitless($value) {
|
|
18
20
|
$value: $value * 1px;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
|
-
@return $value
|
|
23
|
+
@return math.div($value, $govuk-root-font-size) * 1rem;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
/*# sourceMappingURL=_px-to-rem.scss.map */
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
@import "../govuk/tools/if";
|
|
2
|
+
|
|
1
3
|
$govuk-prototype-kit-major-version: 0 !default;
|
|
2
4
|
|
|
3
|
-
$govuk-assets-path: if(
|
|
5
|
+
$govuk-assets-path: govuk-if(
|
|
4
6
|
$govuk-prototype-kit-major-version > 12,
|
|
5
7
|
$govuk-extensions-url-context + "/govuk-frontend/dist/govuk/assets/",
|
|
6
8
|
"/govuk/assets/"
|