govuk_tech_docs 6.4.0.beta → 6.5.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 (53) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +15 -14
  3. data/.github/workflows/build-middleman-artifact.yaml +1 -1
  4. data/.github/workflows/check-documentation-updates.yaml +3 -2
  5. data/.github/workflows/check-gem-version.yaml +1 -1
  6. data/.github/workflows/npm-vulnerability-scanner.yaml +55 -0
  7. data/.github/workflows/pipeline.yaml +10 -4
  8. data/.github/workflows/publish-gem.yaml +1 -1
  9. data/.github/workflows/publish-github-pages.yaml +2 -2
  10. data/.github/workflows/ruby-vulnerability-scanner.yaml +44 -0
  11. data/.github/workflows/test.yaml +2 -1
  12. data/CHANGELOG.md +30 -1
  13. data/README.md +12 -21
  14. data/documentation/config/tech-docs.yml +15 -4
  15. data/documentation/source/configure_project/global_configuration/index.html.md.erb +64 -6
  16. data/documentation/source/maintain_project/use_latest_template/index.html.md.erb +2 -2
  17. data/documentation/source/publish_project/deploy/index.html.md.erb +6 -6
  18. data/documentation/source/write_docs/content/index.html.md.erb +18 -2
  19. data/lib/assets/stylesheets/_govuk_tech_docs.scss +1 -9
  20. data/lib/assets/stylesheets/modules/_technical-documentation.scss +4 -1
  21. data/lib/govuk_tech_docs/contribution_banner.rb +15 -3
  22. data/lib/govuk_tech_docs/version.rb +1 -1
  23. data/lib/govuk_tech_docs/warning_text_extension.rb +1 -1
  24. data/lib/govuk_tech_docs.rb +1 -4
  25. data/lib/source/layouts/_govuk_footer.erb +9 -0
  26. data/lib/source/layouts/_govuk_header.erb +17 -0
  27. data/lib/source/layouts/_service_navigation.erb +24 -24
  28. data/lib/source/layouts/core.erb +22 -5
  29. data/lib/tasks/lint.rake +87 -13
  30. data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +1 -1
  31. data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +1 -1
  32. data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
  33. data/node_modules/govuk-frontend/dist/govuk/components/_index.import.scss +2 -0
  34. data/node_modules/govuk-frontend/dist/govuk/components/_index.scss +2 -0
  35. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_mixin.scss +6 -0
  36. data/node_modules/govuk-frontend/dist/govuk/components/feedback/_feedback.import.scss +6 -0
  37. data/node_modules/govuk-frontend/dist/govuk/components/feedback/_index.import.scss +8 -0
  38. data/node_modules/govuk-frontend/dist/govuk/components/feedback/_index.scss +5 -0
  39. data/node_modules/govuk-frontend/dist/govuk/components/feedback/_mixin.scss +48 -0
  40. data/node_modules/govuk-frontend/dist/govuk/components/footer/_mixin.scss +6 -0
  41. data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/_index.import.scss +8 -0
  42. data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/_index.scss +6 -0
  43. data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/_language-navigation.import.scss +6 -0
  44. data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/_mixin.scss +68 -0
  45. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_mixin.scss +48 -3
  46. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_frontend-version.mixin.scss +1 -1
  47. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_functional-colours.mixin.scss +1 -0
  48. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
  49. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss +16 -2
  50. data/package-lock.json +60 -60
  51. data/package.json +1 -1
  52. metadata +13 -2
  53. data/.github/workflows/dependency-review.yaml +0 -22
@@ -19,7 +19,8 @@ module GovukTechDocs
19
19
  end
20
20
 
21
21
  def report_issue_url
22
- url = config[:source_urls]&.[](:report_issue_url)
22
+ url = config[:tech_docs][:source_urls]&.[](:report_issue_url)
23
+ url ||= config[:source_urls]&.[](:report_issue_url)
23
24
  params = {
24
25
  body: "Problem with '#{current_page.data.title}' (#{config[:tech_docs][:host]}#{current_page.url})",
25
26
  }
@@ -35,11 +36,22 @@ module GovukTechDocs
35
36
  end
36
37
 
37
38
  def repo_url
38
- "https://github.com/#{config[:tech_docs][:github_repo]}"
39
+ github_repo = config[:tech_docs][:github_repo]
40
+ if github_repo.nil? || github_repo.empty?
41
+ raise ArgumentError, "github_repo value not found in config/tech-docs.yml"
42
+ end
43
+
44
+ repo_url = if github_repo.match?(%r{\Ahttps://github\.com/}i)
45
+ github_repo
46
+ else
47
+ "https://github.com/#{github_repo}"
48
+ end
49
+
50
+ repo_url.delete_suffix("/")
39
51
  end
40
52
 
41
53
  def repo_branch
42
- config[:tech_docs][:github_branch] || "master" # TODO: change this to 'main' in a future breaking release
54
+ config[:tech_docs][:github_branch] || "master"
43
55
  end
44
56
 
45
57
  private
@@ -1,3 +1,3 @@
1
1
  module GovukTechDocs
2
- VERSION = "6.4.0.beta".freeze
2
+ VERSION = "6.5.0".freeze
3
3
  end
@@ -5,8 +5,8 @@ module GovukTechDocs
5
5
  end
6
6
 
7
7
  helpers do
8
- warn("This functionality is deprecated and will be removed in a future release. \n You should use the GOV.UK warning text component instead.")
9
8
  def warning_text(text)
9
+ warn("The `warning_text` function will be removed in version 7. You should use the GOV.UK warning text component instead.")
10
10
  <<~EOS
11
11
  <div class="govuk-warning-text">
12
12
  <span class="govuk-warning-text__icon" aria-hidden="true">!</span>
@@ -84,6 +84,7 @@ module GovukTechDocs
84
84
  context.activate :unique_identifier
85
85
  context.activate :warning_text
86
86
  context.activate :api_reference
87
+ context.activate :custom_method_missing_handler
87
88
 
88
89
  context.helpers do
89
90
  include GovukTechDocs::PathHelpers
@@ -164,9 +165,5 @@ module GovukTechDocs
164
165
  else
165
166
  context.ignore "search/*"
166
167
  end
167
-
168
- if context.config[:tech_docs][:enable_govuk_components]
169
- context.activate :custom_method_missing_handler
170
- end
171
168
  end
172
169
  end
@@ -0,0 +1,9 @@
1
+ <%=
2
+
3
+ govukFooter({
4
+ containerClasses: config[:tech_docs][:footerContainerClasses] ? config[:tech_docs][:footerContainerClasses] : "govuk-footer__container--full-width",
5
+ classes: config[:tech_docs][:footerClasses] ? config[:tech_docs][:footerClasses] : "",
6
+
7
+ })
8
+
9
+ %>
@@ -0,0 +1,17 @@
1
+ <%
2
+ service_link = config[:tech_docs][:service_link]
3
+ homepage_url = service_link ? get_path_to_resource(config, service_link, current_page) : nil
4
+
5
+ %>
6
+
7
+ <%=
8
+
9
+ govukHeader({
10
+ homepageUrl: homepage_url || "",
11
+ productName: config[:tech_docs][:product_name] ? config[:tech_docs][:product_name] : "",
12
+ containerClasses: config[:tech_docs][:headerContainerClasses] ? config[:tech_docs][:headerContainerClasses] : "govuk-header__container--full-width",
13
+ classes: config[:tech_docs][:headerClasses] ? config[:tech_docs][:headerClasses] : ""
14
+
15
+ })
16
+
17
+ %>
@@ -1,24 +1,24 @@
1
- <div class="govuk-service-navigation app-pane__navigation" data-module="govuk-service-navigation">
2
- <div class="govuk-width-container">
3
- <div class="govuk-service-navigation__container">
4
- <nav aria-label="Menu" class="govuk-service-navigation__wrapper">
5
- <button type="button" class="govuk-service-navigation__toggle govuk-js-service-navigation-toggle" aria-controls="navigation" hidden aria-hidden="true">
6
- Menu
7
- </button>
8
- <ul class="govuk-service-navigation__list" id="navigation">
9
- <% config[:tech_docs][:header_links].each do |title, path| %>
10
- <li class="govuk-service-navigation__item <% if active_page(path) %> govuk-service-navigation__item--active<% end %>">
11
- <a class="govuk-service-navigation__link" href="<%= get_path_to_resource config, path, current_page %>"<% if active_page(path) %> aria-current="page"<% end %>>
12
- <% if active_page(path) %>
13
- <strong class="govuk-service-navigation__active-fallback"><%= title %></strong>
14
- <% else %>
15
- <%= title %>
16
- <% end %>
17
- </a>
18
- </li>
19
- <% end %>
20
- </ul>
21
- </nav>
22
- </div>
23
- </div>
24
- </div>
1
+ <%
2
+
3
+ navigation = []
4
+ config[:tech_docs][:header_links].each do |title, path|
5
+ url = get_path_to_resource config, path, current_page
6
+ navigation.append << {
7
+ href: url,
8
+ text: title,
9
+ active: active_page(path)
10
+ }
11
+ end
12
+
13
+ %>
14
+
15
+
16
+ <%=
17
+ govukServiceNavigation({
18
+ navigation: navigation,
19
+ serviceUrl: config[:tech_docs][:service_link] ,
20
+ serviceName: config[:tech_docs][:service_name],
21
+ navigationClasses: config[:tech_docs][:navigationContainerClasses] ? config[:tech_docs][:navigationContainerClasses] : "",
22
+ classes: config[:tech_docs][:navigationClasses] ? config[:tech_docs][:navigationClasses] : ""
23
+ })
24
+ %>
@@ -50,9 +50,23 @@
50
50
 
51
51
  <body class="govuk-template__body">
52
52
  <script>document.body.className += ' js-enabled' + ('noModule' in HTMLScriptElement.prototype ? ' govuk-frontend-supported' : '');</script>
53
- <header class="govuk-template__header app-header">
54
- <%= partial 'layouts/header' %>
55
- </header>
53
+ <!-- .app-header aligns the header component properly with the in page navigation -->
54
+ <div class="app-header" role="banner" data-module="govuk-header">
55
+ <% if config[:tech_docs][:show_govuk_logo] %>
56
+ <%= partial 'layouts/govuk_header' %>
57
+ <% else %>
58
+ <%=
59
+ # if show govuk_logo is true we can just use the govuk component.
60
+ # If not we need to fall back temporarily to the old custom header to make sure we don't start
61
+ # showing logos everywhere, as there is no option in the component to turn it off. This will be removed once the generic header and branding is in place.
62
+ # We will raise a deprecation warning to let people know this is imminent
63
+ warn("You have set show_govuk_logo to false or removed it from your config. This setting wil be removed in version 7 to be replaced by the generic header and custom logo. If you rely on this setting for custom code you should review this as soon as possible.")
64
+ %>
65
+ <%= partial 'layouts/header' %>
66
+ <% end %>
67
+
68
+ </div>
69
+
56
70
  <% if config[:tech_docs][:header_links] %>
57
71
  <%= partial 'layouts/service_navigation' %>
58
72
  <% end %>
@@ -102,9 +116,12 @@
102
116
  </div>
103
117
  </div>
104
118
 
105
-
106
119
  <footer class="govuk-template__footer">
107
- <%= partial "layouts/footer" %>
120
+ <% if config[:tech_docs][:show_govuk_logo] %>
121
+ <%= partial "layouts/govuk_footer" %>
122
+ <% else %>
123
+ <%= partial "layouts/footer" %>
124
+ <% end %>
108
125
  </footer>
109
126
 
110
127
  <%= partial 'layouts/analytics' %>
data/lib/tasks/lint.rake CHANGED
@@ -1,33 +1,107 @@
1
1
  # Rakefile
2
2
  require "json"
3
- require "open3"
3
+ require "timeout" # Built into standard Ruby
4
4
  require_relative "./helpers/rake_utils"
5
5
  require_relative "./helpers/vale_report"
6
6
 
7
7
  namespace :lint do
8
- # task vale_sync:
9
- desc "Run tech-docs-linter to check content against GOV.UK style guide."
8
+ desc "Run linter to check content against GOV.UK style guide."
10
9
  task :vale, [:target, :clean_build, :full_output] do |_t, args|
11
10
  args.with_defaults(target: "./build", clean_build: "true", full_output: "true")
12
11
 
13
- sh "bundle exec vale sync --config='#{vale_config_path}'"
12
+ Rake::Task["middleman:build"].invoke if args.clean_build == "true"
14
13
 
15
- if args.clean_build == "true"
16
- Rake::Task["middleman:build"].invoke
14
+ files = Dir.glob("#{args.target}/**/*.{html,md}")
15
+ puts "Running Vale against #{files.count} files...\n\n"
16
+
17
+ combined_json = {}
18
+
19
+ files.each do |file|
20
+ print "Linting #{file}... "
21
+
22
+ file_output = ""
23
+
24
+ # IO.popen runs the command and exposes the Process ID (PID)
25
+ IO.popen(["vale", "--config=#{vale_config_path}", "--output=JSON", file]) do |io|
26
+ begin
27
+ # If a file takes longer than 10 seconds, raise a timeout
28
+ Timeout.timeout(10) do
29
+ file_output = io.read
30
+ end
31
+ # If we reach here, it finished safely
32
+ puts "\e[32mDone\e[0m"
33
+ rescue Timeout::Error
34
+ # The regex hung. Send a SIGKILL to the Vale process to stop it chewing CPU
35
+ Process.kill("KILL", io.pid)
36
+ puts "\e[31mHUNG (Skipped due to timeout)\e[0m" # Red text
37
+ end
38
+ end
39
+
40
+ # Merge JSON only if we got a valid response (ignores timeouts)
41
+ unless file_output.strip.empty?
42
+ parsed_output = JSON.parse(file_output)
43
+ combined_json.merge!(parsed_output) unless parsed_output.empty?
44
+ end
17
45
  end
18
46
 
19
- stdout, = Open3.capture3("vale --config='#{vale_config_path}' --output=JSON #{args.target}")
47
+ puts "\nGenerating report..."
20
48
 
21
- linter_report = ValeLinterReport.new(stdout)
49
+ linter_report = ValeLinterReport.new(combined_json.to_json)
22
50
  linter_report.format_linter_output
23
- if args.full_output == "true"
24
- puts linter_report.get_linter_full_report
25
- end
51
+
52
+ puts linter_report.get_linter_full_report if args.full_output == "true"
26
53
  puts linter_report.get_linter_summary_report
27
54
 
28
- # finish with a Ci friendly json string
29
55
  linter_report.linter_summary_report_json
30
- # Always exit 0 so individual project pipelines can evaluate the data themselves
31
56
  exit 0
32
57
  end
58
+
59
+ desc "Debug Vale to find which rule hangs on a specific file."
60
+ require 'timeout'
61
+
62
+ desc "Debug specific Vale rules for regex hangs"
63
+ task :debug, [:rules] do |_, args|
64
+ # Accepts Rake args (rake "debug[Rule1,Rule2]") or ENV vars (rake debug RULES=Rule1,Rule2)
65
+ raw_input = args[:rules] || ENV['RULES']
66
+
67
+ if raw_input.nil? || raw_input.strip.empty?
68
+ abort "Please provide rules to test. \nUsage: rake \"debug[Rule1,Rule2]\" OR rake debug RULES=Rule1,Rule2"
69
+ end
70
+
71
+ # Split by comma, remove whitespace, and drop any empty strings
72
+ rules = raw_input.split(',').map(&:strip).reject(&:empty?)
73
+
74
+ style_prefix = 'style-guide'
75
+ target_file = './build/search/index.html'
76
+
77
+ puts "Hunting for the hanging regex in #{target_file}..."
78
+ puts "Testing #{rules.size} rule(s): #{rules.join(', ')}\n\n"
79
+
80
+ rules.each do |rule_name|
81
+ full_rule = "#{style_prefix}.#{rule_name}"
82
+ print "Testing #{full_rule}... "
83
+ filter_string = ".Name=='#{full_rule}'"
84
+
85
+ # Run Vale for just this single rule
86
+ IO.popen(["vale", "--filter=#{filter_string}", "--output=line", target_file]) do |io|
87
+ begin
88
+ # If the regex loops catastrophically, it hits this 5-second limit
89
+ Timeout.timeout(5) do
90
+ io.read
91
+ end
92
+
93
+ # If it finishes within 5 seconds, the rule is safe
94
+ puts "\e[32mPassed (No hang)\e[0m"
95
+
96
+ rescue Timeout::Error
97
+ # The regex froze! Kill the underlying process to save CPU and flag it
98
+ Process.kill("KILL", io.pid)
99
+ puts "\e[31m💥 HUNG! (This is the broken regex)\e[0m"
100
+ end
101
+ end
102
+ end
103
+
104
+ exit 0
105
+ end
106
+
33
107
  end
@@ -4,7 +4,7 @@
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.GOVUKFrontend = global.GOVUKFrontend || {}));
5
5
  })(this, (function (exports) { 'use strict';
6
6
 
7
- const version = '6.4.0';
7
+ const version = '6.5.1';
8
8
 
9
9
  function getBreakpoint(name) {
10
10
  const property = `--govuk-breakpoint-${name}`;
@@ -1,4 +1,4 @@
1
- const version = '6.4.0';
1
+ const version = '6.5.1';
2
2
 
3
3
  function getBreakpoint(name) {
4
4
  const property = `--govuk-breakpoint-${name}`;
@@ -1,4 +1,4 @@
1
- const version = '6.4.0';
1
+ const version = '6.5.1';
2
2
 
3
3
  export { version };
4
4
  //# sourceMappingURL=govuk-frontend-version.mjs.map
@@ -10,6 +10,7 @@
10
10
  @import "error-message";
11
11
  @import "error-summary";
12
12
  @import "exit-this-page";
13
+ @import "feedback";
13
14
  @import "fieldset";
14
15
  @import "file-upload";
15
16
  @import "footer";
@@ -19,6 +20,7 @@
19
20
  @import "input";
20
21
  @import "inset-text";
21
22
  @import "label";
23
+ @import "language-navigation";
22
24
  @import "notification-banner";
23
25
  @import "pagination";
24
26
  @import "panel";
@@ -10,6 +10,7 @@
10
10
  @use "error-message";
11
11
  @use "error-summary";
12
12
  @use "exit-this-page";
13
+ @use "feedback";
13
14
  @use "fieldset";
14
15
  @use "file-upload";
15
16
  @use "footer";
@@ -19,6 +20,7 @@
19
20
  @use "input";
20
21
  @use "inset-text";
21
22
  @use "label";
23
+ @use "language-navigation";
22
24
  @use "notification-banner";
23
25
  @use "pagination";
24
26
  @use "panel";
@@ -16,6 +16,12 @@
16
16
 
17
17
  color: base.govuk-functional-colour(surface-text);
18
18
  background-color: base.govuk-functional-colour(surface-background);
19
+
20
+ @media print {
21
+ border-bottom-color: currentcolor;
22
+ color: base.govuk-functional-colour(print-text);
23
+ background-color: transparent;
24
+ }
19
25
  }
20
26
 
21
27
  // Support older browsers which don't hide elements with the `hidden` attribute
@@ -0,0 +1,6 @@
1
+ @use "../../settings/warnings--internal";
2
+
3
+ @include warnings--internal.component-scss-file-warning("feedback");
4
+
5
+ @import "index";
6
+
@@ -0,0 +1,8 @@
1
+ @use "mixin";
2
+
3
+ @import "../../base";
4
+
5
+ @include govuk-exports("govuk/component/feedback") {
6
+ @include mixin.styles;
7
+ }
8
+
@@ -0,0 +1,5 @@
1
+ @use "../../custom-properties";
2
+ @use "mixin";
3
+
4
+ @include mixin.styles;
5
+
@@ -0,0 +1,48 @@
1
+ @use "../../base";
2
+
3
+ /// @access private
4
+ @mixin styles {
5
+ .govuk-feedback {
6
+ box-sizing: border-box;
7
+ // Tie left/right padding to page gutter as it stretches across the whole
8
+ // screen on smaller screens
9
+ padding: base.govuk-spacing(4) base.$govuk-gutter-half base.govuk-spacing(5);
10
+ border-top: 1px solid;
11
+ border-color: base.govuk-functional-colour("brand");
12
+ background-color: base.govuk-functional-colour("surface-background");
13
+
14
+ @media #{base.govuk-from-breakpoint(tablet)} {
15
+ padding-right: base.govuk-spacing(4);
16
+ padding-left: base.govuk-spacing(4);
17
+ }
18
+
19
+ // Override $govuk-width-container's left and right margin as we want Feedback
20
+ // to go across the whole screen on smaller screens
21
+ @media #{base.govuk-until-breakpoint(tablet)} {
22
+ margin-right: 0;
23
+ margin-left: 0;
24
+ }
25
+
26
+ @media print {
27
+ border-color: currentcolor;
28
+ background-color: transparent;
29
+ }
30
+ }
31
+
32
+ .govuk-feedback__title {
33
+ @include base.govuk-font($size: 24, $weight: bold);
34
+ margin-top: 0;
35
+ color: base.govuk-functional-colour(text);
36
+ @include base.govuk-responsive-margin(1, "bottom");
37
+ }
38
+
39
+ // Removes the bottom margin from the final child element eg: a paragraph
40
+ //
41
+ // Feedback body doesn't have any opinions about typography. Instead we defer
42
+ // to users to use typography classes in their input, or apply a `govuk-body`
43
+ // paragraph for if users pass `text`.
44
+ .govuk-feedback__body > :last-child {
45
+ margin-bottom: 0;
46
+ }
47
+ }
48
+
@@ -19,6 +19,12 @@
19
19
  border-top-color: base.govuk-functional-colour(brand);
20
20
  color: $govuk-footer-text;
21
21
  background: base.govuk-functional-colour(template-background);
22
+
23
+ @media print {
24
+ border-top-color: currentcolor;
25
+ color: base.govuk-functional-colour(text);
26
+ background-color: transparent;
27
+ }
22
28
  }
23
29
 
24
30
  .govuk-footer__crown {
@@ -0,0 +1,8 @@
1
+ @use "mixin";
2
+
3
+ @import "../../base";
4
+
5
+ @include govuk-exports("govuk/component/language-navigation") {
6
+ @include mixin.styles;
7
+ }
8
+
@@ -0,0 +1,6 @@
1
+ @use "../../custom-properties";
2
+
3
+ @use "mixin";
4
+
5
+ @include mixin.styles;
6
+
@@ -0,0 +1,6 @@
1
+ @use "../../settings/warnings--internal";
2
+
3
+ @include warnings--internal.component-scss-file-warning("language-navigation");
4
+
5
+ @import "index";
6
+
@@ -0,0 +1,68 @@
1
+ @use "../../base";
2
+
3
+ /// @access private
4
+ @mixin styles {
5
+ .govuk-language-navigation {
6
+ @include base.govuk-font($size: 19);
7
+
8
+ @include base.govuk-responsive-margin(6, "bottom");
9
+ color: base.govuk-functional-colour(text);
10
+ }
11
+
12
+ .govuk-language-navigation__list {
13
+ display: inline-flex;
14
+ flex-wrap: wrap;
15
+ row-gap: base.govuk-spacing(2);
16
+ margin: 0;
17
+ padding: 0;
18
+ list-style-type: none;
19
+ }
20
+
21
+ .govuk-language-navigation__list-item {
22
+ display: flex;
23
+ align-items: center;
24
+
25
+ &:not(:last-child) {
26
+ &::after {
27
+ content: "";
28
+ display: block;
29
+ height: 1em;
30
+ margin-right: base.govuk-spacing(2);
31
+ margin-left: base.govuk-spacing(2);
32
+ border-right: 1px solid;
33
+ border-right-color: base.govuk-functional-colour(border);
34
+ }
35
+ }
36
+ }
37
+
38
+ .govuk-language-navigation__link {
39
+ @include base.govuk-link-common;
40
+ @include base.govuk-link-style-default;
41
+ }
42
+
43
+ .govuk-language-navigation--inverse {
44
+ color: base.govuk-functional-colour(inverse-text);
45
+
46
+ .govuk-language-navigation__link {
47
+ @include base.govuk-link-style-inverse;
48
+ }
49
+
50
+ .govuk-language-navigation__list-item::after {
51
+ border-right-color: currentcolor;
52
+ }
53
+ }
54
+
55
+ // Ensure the Language navigation has enough
56
+ // spacing with the rest of the Service Navigation
57
+ .govuk-service-navigation .govuk-language-navigation {
58
+ // Slightly smaller margin because the Service Navigation's menu toggle
59
+ // has a little margin underneath it already.
60
+ margin-top: base.govuk-spacing(1);
61
+ margin-bottom: base.govuk-spacing(3);
62
+
63
+ @media #{base.govuk-from-breakpoint(tablet)} {
64
+ margin-top: base.govuk-spacing(3);
65
+ }
66
+ }
67
+ }
68
+
@@ -20,6 +20,28 @@
20
20
  --govuk-text-colour: #{$govuk-service-navigation-text-colour};
21
21
  color: base.govuk-functional-colour(text);
22
22
  background-color: $govuk-service-navigation-background;
23
+
24
+ @media print {
25
+ border-bottom-color: currentcolor;
26
+ background-color: transparent;
27
+ }
28
+ }
29
+
30
+ .govuk-service-navigation__inlining-container {
31
+ display: flex;
32
+ flex-wrap: wrap;
33
+ align-items: baseline;
34
+
35
+ .govuk-service-navigation__container {
36
+ // Expand the container to shift the `end` slot to the right
37
+ flex-grow: 1;
38
+
39
+ // Ensure some space between the `end` slot and the container
40
+ // when displayed inline
41
+ &:not(:last-child) {
42
+ margin-right: base.govuk-spacing(6);
43
+ }
44
+ }
23
45
  }
24
46
 
25
47
  .govuk-service-navigation__container {
@@ -27,9 +49,16 @@
27
49
  flex-direction: column;
28
50
  align-items: start;
29
51
 
52
+ // Avoid the end slot rendering on the right of the container
53
+ // in small viewports by ensuring the container is full width
54
+ @media #{base.govuk-until-breakpoint(tablet)} {
55
+ width: 100%;
56
+ }
57
+
30
58
  @media #{base.govuk-from-breakpoint(tablet)} {
31
59
  flex-direction: row;
32
60
  flex-wrap: wrap;
61
+ align-items: center;
33
62
  }
34
63
  }
35
64
 
@@ -65,6 +94,10 @@
65
94
  @include base.govuk-responsive-margin(6, $direction: right);
66
95
  }
67
96
  }
97
+
98
+ @media print {
99
+ border-color: currentcolor;
100
+ }
68
101
  }
69
102
 
70
103
  // Remove the top margin of the first nav item if there is a service name but
@@ -207,10 +240,19 @@
207
240
  --govuk-text-colour: #{base.govuk-functional-colour(inverse-text)};
208
241
  background-color: base.govuk-functional-colour(brand);
209
242
 
243
+ @media print {
244
+ --govuk-text-colour: #{base.govuk-functional-colour(print-text)};
245
+ background-color: transparent;
246
+ }
247
+
210
248
  .govuk-width-container {
211
249
  border-width: 1px 0;
212
250
  border-style: solid;
213
251
  border-color: $govuk-service-navigation-border-colour;
252
+
253
+ @media print {
254
+ border-color: currentcolor;
255
+ }
214
256
  }
215
257
 
216
258
  // Subtract 1px of space to account for the extra border-top
@@ -224,9 +266,12 @@
224
266
  border-color: currentcolor;
225
267
  }
226
268
 
227
- // Override link styles
228
- .govuk-service-navigation__link {
229
- @include base.govuk-link-style-text;
269
+ // Override link styles if on screens
270
+ // In print, we want the normal link styles to still apply
271
+ @media not print {
272
+ .govuk-service-navigation__link {
273
+ @include base.govuk-link-style-text;
274
+ }
230
275
  }
231
276
 
232
277
  // Override mobile menu toggle colour when not focused
@@ -7,7 +7,7 @@
7
7
  // `$govuk-output-custom-properties` is true or not to help with checking if
8
8
  // multiple stylesheets are outputting the same version
9
9
  :root {
10
- --govuk-frontend-version: "6.4.0";
10
+ --govuk-frontend-version: "6.5.1";
11
11
  }
12
12
  }
13
13