govuk_tech_docs 5.2.2 → 6.0.0.beta

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 (145) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -0
  3. data/CHANGELOG.md +15 -0
  4. data/README.md +11 -3
  5. data/example/config/tech-docs.yml +1 -1
  6. data/govuk_tech_docs.gemspec +1 -1
  7. data/lib/assets/stylesheets/_core.scss +1 -0
  8. data/lib/assets/stylesheets/_govuk_tech_docs.scss +13 -15
  9. data/lib/assets/stylesheets/modules/_app-pane.scss +3 -3
  10. data/lib/assets/stylesheets/modules/_page-review.scss +4 -4
  11. data/lib/assets/stylesheets/modules/_search.scss +3 -3
  12. data/lib/assets/stylesheets/modules/_service-navigation.scss +5 -0
  13. data/lib/assets/stylesheets/modules/_technical-documentation.scss +7 -7
  14. data/lib/assets/stylesheets/modules/_toc.scss +13 -13
  15. data/lib/assets/stylesheets/palette/_syntax-highlighting.scss +9 -7
  16. data/lib/govuk_tech_docs/meta_tags.rb +1 -1
  17. data/lib/govuk_tech_docs/version.rb +1 -1
  18. data/lib/source/layouts/_header.erb +2 -16
  19. data/lib/source/layouts/_service_navigation.erb +27 -0
  20. data/lib/source/layouts/core.erb +7 -7
  21. data/node_modules/govuk-frontend/dist/govuk/_base.scss +1 -0
  22. data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +87 -229
  23. data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +88 -229
  24. data/node_modules/govuk-frontend/dist/govuk/all.mjs +0 -1
  25. data/node_modules/govuk-frontend/dist/govuk/assets/images/favicon.ico +0 -0
  26. data/node_modules/govuk-frontend/dist/govuk/assets/images/favicon.svg +1 -1
  27. data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-180.png +0 -0
  28. data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-192.png +0 -0
  29. data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-512.png +0 -0
  30. data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-opengraph-image.png +0 -0
  31. data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
  32. data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss +18 -15
  33. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js +1 -126
  34. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs +1 -126
  35. data/node_modules/govuk-frontend/dist/govuk/components/back-link/_index.scss +2 -2
  36. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_index.scss +2 -2
  37. data/node_modules/govuk-frontend/dist/govuk/components/button/_index.scss +18 -21
  38. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss +2 -2
  39. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js +20 -135
  40. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs +20 -135
  41. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs +19 -9
  42. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_index.scss +7 -6
  43. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.scss +2 -5
  44. data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss +5 -0
  45. data/node_modules/govuk-frontend/dist/govuk/components/details/_index.scss +6 -4
  46. data/node_modules/govuk-frontend/dist/govuk/components/error-message/_index.scss +1 -1
  47. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_index.scss +4 -2
  48. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_index.scss +1 -1
  49. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js +1 -126
  50. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs +1 -126
  51. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss +30 -38
  52. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js +36 -132
  53. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs +36 -132
  54. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs +35 -6
  55. data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss +30 -27
  56. data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss +89 -449
  57. data/node_modules/govuk-frontend/dist/govuk/components/hint/_index.scss +1 -1
  58. data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss +14 -20
  59. data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_index.scss +2 -1
  60. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss +10 -8
  61. data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss +12 -11
  62. data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss +4 -4
  63. data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.scss +2 -2
  64. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js +1 -126
  65. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs +1 -126
  66. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss +12 -6
  67. data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss +8 -7
  68. data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss +6 -11
  69. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss +55 -76
  70. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js +30 -2
  71. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs +30 -2
  72. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.mjs +30 -2
  73. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss +7 -2
  74. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss +25 -21
  75. data/node_modules/govuk-frontend/dist/govuk/components/table/_index.scss +7 -8
  76. data/node_modules/govuk-frontend/dist/govuk/components/tabs/_index.scss +9 -6
  77. data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.scss +66 -31
  78. data/node_modules/govuk-frontend/dist/govuk/components/task-list/_index.scss +7 -5
  79. data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss +5 -10
  80. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss +5 -4
  81. data/node_modules/govuk-frontend/dist/govuk/core/_index.scss +0 -1
  82. data/node_modules/govuk-frontend/dist/govuk/core/_lists.scss +2 -2
  83. data/node_modules/govuk-frontend/dist/govuk/core/_section-break.scss +2 -1
  84. data/node_modules/govuk-frontend/dist/govuk/core/_typography.scss +6 -20
  85. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_breakpoints.scss +17 -0
  86. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_frontend-version.scss +15 -0
  87. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_functional-colours.scss +17 -0
  88. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_index.scss +5 -0
  89. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
  90. data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss +168 -82
  91. data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss +41 -6
  92. data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.scss +1 -1
  93. data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss +24 -40
  94. data/node_modules/govuk-frontend/dist/govuk/helpers/_media-queries.scss +172 -33
  95. data/node_modules/govuk-frontend/dist/govuk/helpers/_spacing.scss +1 -1
  96. data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss +6 -30
  97. data/node_modules/govuk-frontend/dist/govuk/i18n.mjs +1 -126
  98. data/node_modules/govuk-frontend/dist/govuk/init.mjs +1 -2
  99. data/node_modules/govuk-frontend/dist/govuk/objects/_button-group.scss +1 -1
  100. data/node_modules/govuk-frontend/dist/govuk/objects/_form-group.scss +2 -1
  101. data/node_modules/govuk-frontend/dist/govuk/objects/_main-wrapper.scss +1 -1
  102. data/node_modules/govuk-frontend/dist/govuk/objects/_template.scss +3 -7
  103. data/node_modules/govuk-frontend/dist/govuk/objects/_width-container.scss +2 -2
  104. data/node_modules/govuk-frontend/dist/govuk/overrides/_display.scss +1 -1
  105. data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.scss +0 -2
  106. data/node_modules/govuk-frontend/dist/govuk/overrides/_width.scss +5 -5
  107. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-applied.scss +3 -188
  108. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-functional.scss +366 -0
  109. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss +9 -255
  110. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-palette.scss +117 -25
  111. data/node_modules/govuk-frontend/dist/govuk/settings/_custom-properties.scss +18 -0
  112. data/node_modules/govuk-frontend/dist/govuk/settings/_index.scss +3 -14
  113. data/node_modules/govuk-frontend/dist/govuk/settings/_media-queries.scss +0 -9
  114. data/node_modules/govuk-frontend/dist/govuk/settings/_typography-responsive.scss +12 -189
  115. data/node_modules/govuk-frontend/dist/govuk/tools/_index.scss +0 -1
  116. data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss +4 -2
  117. data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-rem.scss +2 -0
  118. data/package-lock.json +3228 -4
  119. data/package.json +1 -1
  120. metadata +10 -26
  121. data/node_modules/govuk-frontend/dist/govuk/all.scss +0 -9
  122. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/favicon.ico +0 -0
  123. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/favicon.svg +0 -1
  124. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-crest.svg +0 -1
  125. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-180.png +0 -0
  126. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-192.png +0 -0
  127. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-512.png +0 -0
  128. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-mask.svg +0 -1
  129. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-opengraph-image.png +0 -0
  130. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/manifest.json +0 -39
  131. data/node_modules/govuk-frontend/dist/govuk/components/_all.scss +0 -10
  132. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js +0 -238
  133. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs +0 -230
  134. data/node_modules/govuk-frontend/dist/govuk/components/header/header.mjs +0 -89
  135. data/node_modules/govuk-frontend/dist/govuk/core/_all.scss +0 -10
  136. data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss +0 -15
  137. data/node_modules/govuk-frontend/dist/govuk/helpers/_all.scss +0 -10
  138. data/node_modules/govuk-frontend/dist/govuk/objects/_all.scss +0 -10
  139. data/node_modules/govuk-frontend/dist/govuk/overrides/_all.scss +0 -9
  140. data/node_modules/govuk-frontend/dist/govuk/settings/_all.scss +0 -10
  141. data/node_modules/govuk-frontend/dist/govuk/tools/_all.scss +0 -10
  142. data/node_modules/govuk-frontend/dist/govuk/tools/_rebrand.scss +0 -65
  143. data/node_modules/govuk-frontend/dist/govuk/utilities/_all.scss +0 -10
  144. data/node_modules/govuk-frontend/dist/govuk/vendor/_sass-mq.scss +0 -349
  145. data/node_modules/govuk-frontend/dist/govuk-prototype-kit/functions.js +0 -25
@@ -30,7 +30,7 @@
30
30
  padding-top: govuk-spacing(4);
31
31
  padding-bottom: govuk-spacing(4);
32
32
 
33
- @include govuk-media-query($from: tablet) {
33
+ @media #{govuk-from-breakpoint(tablet)} {
34
34
  // This spacing is manually adjusted to replicate the margin of
35
35
  // govuk-heading-xl (50px) minus the spacing of back link and
36
36
  // breadcrumbs (10px)
@@ -5,11 +5,7 @@
5
5
  .govuk-template {
6
6
  // Set the overall page background colour to the same colour as used by the
7
7
  // footer to give the illusion of a long footer.
8
- @include _govuk-rebrand(
9
- background-color,
10
- $from: $govuk-template-background-colour,
11
- $to: $_govuk-rebrand-template-background-colour
12
- );
8
+ background-color: govuk-functional-colour(template-background);
13
9
 
14
10
  // Prevent automatic text sizing, as we already cater for small devices and
15
11
  // would like the browser to stay on 100% text zoom by default.
@@ -39,7 +35,7 @@
39
35
 
40
36
  // Force the scrollbar to always display in IE, to prevent horizontal page
41
37
  // jumps as content height changes (e.g. autocomplete results open).
42
- @include govuk-media-query($media-type: screen) {
38
+ @media screen {
43
39
  overflow-y: scroll;
44
40
  }
45
41
  }
@@ -50,7 +46,7 @@
50
46
  // own containers.
51
47
  margin: 0;
52
48
  // Set the overall body of the page back to the typical background colour.
53
- background-color: $govuk-body-background-colour;
49
+ background-color: govuk-functional-colour(body-background);
54
50
  }
55
51
  }
56
52
 
@@ -37,7 +37,7 @@
37
37
  }
38
38
 
39
39
  // On tablet, add full width gutters
40
- @include govuk-media-query($from: tablet) {
40
+ @media #{govuk-from-breakpoint(tablet)} {
41
41
  margin-right: $govuk-gutter;
42
42
  margin-left: $govuk-gutter;
43
43
 
@@ -55,7 +55,7 @@
55
55
 
56
56
  // As soon as the viewport is greater than the width of the page plus the
57
57
  // gutters, just centre the content instead of adding gutters.
58
- @include govuk-media-query($and: "(min-width: #{($width + $govuk-gutter * 2)})") {
58
+ @media (min-width: #{($width + $govuk-gutter * 2)}) {
59
59
  margin-right: auto;
60
60
  margin-left: auto;
61
61
 
@@ -16,7 +16,7 @@
16
16
  display: none !important;
17
17
  }
18
18
 
19
- @include govuk-media-query($media-type: print) {
19
+ @media print {
20
20
  .govuk-\!-display-none-print {
21
21
  display: none !important;
22
22
  }
@@ -3,8 +3,6 @@
3
3
 
4
4
  // Generate typography override classes for each responsive font map in the
5
5
  // typography scale eg .govuk-\!-font-size-80
6
- //
7
- // govuk-!-font-size-14 is deprecated
8
6
  @each $size, $font-map in $govuk-typography-scale {
9
7
  .govuk-\!-font-size-#{$size} {
10
8
  $font-map: map-get($govuk-typography-scale, $size);
@@ -7,7 +7,7 @@
7
7
  .govuk-\!-width-three-quarters {
8
8
  width: 100% !important;
9
9
 
10
- @include govuk-media-query($from: tablet) {
10
+ @media #{govuk-from-breakpoint(tablet)} {
11
11
  width: 75% !important;
12
12
  }
13
13
  }
@@ -15,7 +15,7 @@
15
15
  .govuk-\!-width-two-thirds {
16
16
  width: 100% !important;
17
17
 
18
- @include govuk-media-query($from: tablet) {
18
+ @media #{govuk-from-breakpoint(tablet)} {
19
19
  width: 66.66% !important;
20
20
  }
21
21
  }
@@ -23,7 +23,7 @@
23
23
  .govuk-\!-width-one-half {
24
24
  width: 100% !important;
25
25
 
26
- @include govuk-media-query($from: tablet) {
26
+ @media #{govuk-from-breakpoint(tablet)} {
27
27
  width: 50% !important;
28
28
  }
29
29
  }
@@ -31,7 +31,7 @@
31
31
  .govuk-\!-width-one-third {
32
32
  width: 100% !important;
33
33
 
34
- @include govuk-media-query($from: tablet) {
34
+ @media #{govuk-from-breakpoint(tablet)} {
35
35
  width: 33.33% !important;
36
36
  }
37
37
  }
@@ -39,7 +39,7 @@
39
39
  .govuk-\!-width-one-quarter {
40
40
  width: 100% !important;
41
41
 
42
- @include govuk-media-query($from: tablet) {
42
+ @media #{govuk-from-breakpoint(tablet)} {
43
43
  width: 25% !important;
44
44
  }
45
45
  }
@@ -2,194 +2,9 @@
2
2
  /// @group settings/colours
3
3
  ////
4
4
 
5
- @import "../helpers/colour";
5
+ @warn "The '_colours-applied' file is deprecated. Please import '_colours-functional' instead. "
6
+ + "See https://github.com/alphagov/govuk-frontend/releases/tag/v6.0.0 for more details.";
6
7
 
7
- // =========================================================
8
- // Generic
9
- // =========================================================
10
-
11
- /// Brand colour
12
- ///
13
- /// @type Colour
14
- /// @access public
15
-
16
- $govuk-brand-colour: govuk-colour("blue") !default;
17
-
18
- /// Text colour
19
- ///
20
- /// @type Colour
21
- /// @access public
22
-
23
- $govuk-text-colour: govuk-colour("black") !default;
24
-
25
- /// Canvas background colour
26
- ///
27
- /// Used by the footer component and template to give the illusion of a long
28
- /// footer.
29
- ///
30
- /// @type Colour
31
- /// @access public
32
- /// @deprecated "$govuk-canvas-background-colour has been deprecated and will be removed in the next major
33
- /// version. Use `$govuk-template-background-colour` if you want to change the background of
34
- /// the `<html>` element and background colour of elements that need to match for visual
35
- /// continuity.
36
- $govuk-canvas-background-colour: govuk-colour("light-grey") !default;
37
-
38
- // Output a deprecation warning if $govuk-canvas-background-colour is being overridden
39
- // Remove in next major version.
40
- @if $govuk-canvas-background-colour != govuk-colour("light-grey") {
41
- @include _warning(
42
- "$govuk-canvas-background-colour",
43
- "$govuk-canvas-background-colour has been deprecated and will be removed in the next major version."
44
- );
45
- }
46
-
47
- /// Template background colour
48
- ///
49
- /// Used by components that want to give the illusion of extending
50
- /// the template background (such as the footer and cookie banner).
51
- ///
52
- /// @type Colour
53
- /// @access public
54
-
55
- $govuk-template-background-colour: govuk-colour("light-grey") !default;
56
-
57
- /// Body background colour
58
- ///
59
- /// @type Colour
60
- /// @access public
61
-
62
- $govuk-body-background-colour: govuk-colour("white") !default;
63
-
64
- /// Text colour for print media
65
- ///
66
- /// Use 'true black' to avoid printers using colour ink to print body text
67
- ///
68
- /// @type Colour
69
- /// @access public
70
-
71
- $govuk-print-text-colour: #000000 !default;
72
-
73
- /// Secondary text colour
74
- ///
75
- /// Used in for example 'muted' text and help text.
76
- ///
77
- /// @type Colour
78
- /// @access public
79
-
80
- $govuk-secondary-text-colour: govuk-colour("dark-grey") !default;
81
-
82
- /// Focus colour
83
- ///
84
- /// Used for outline (and background, where appropriate) when interactive
85
- /// elements (links, form controls) have keyboard focus.
86
- ///
87
- /// @type Colour
88
- /// @access public
89
-
90
- $govuk-focus-colour: govuk-colour("yellow") !default;
91
-
92
- /// Focused text colour
93
- ///
94
- /// Ensure that the contrast between the text and background colour passes
95
- /// WCAG Level AA contrast requirements.
96
- ///
97
- /// @type Colour
98
- /// @access public
99
-
100
- $govuk-focus-text-colour: govuk-colour("black") !default;
101
-
102
- /// Error colour
103
- ///
104
- /// Used to highlight error messages and form controls in an error state
105
- ///
106
- /// @type Colour
107
- /// @access public
108
-
109
- $govuk-error-colour: govuk-colour("red") !default;
110
-
111
- /// Success colour
112
- ///
113
- /// Used to highlight success messages and banners
114
- ///
115
- /// @type Colour
116
- /// @access public
117
-
118
- $govuk-success-colour: govuk-colour("green") !default;
119
-
120
- /// Border colour
121
- ///
122
- /// Used in for example borders, separators, rules and keylines.
123
- ///
124
- /// @type Colour
125
- /// @access public
126
-
127
- $govuk-border-colour: govuk-colour("mid-grey") !default;
128
-
129
- /// Input border colour
130
- ///
131
- /// Used for form inputs and controls
132
- ///
133
- /// @type Colour
134
- /// @access public
135
-
136
- $govuk-input-border-colour: govuk-colour("black") !default;
137
-
138
- /// Input hover colour
139
- ///
140
- /// Used for hover states on form controls
141
- ///
142
- /// @type Colour
143
- /// @access public
144
-
145
- $govuk-hover-colour: govuk-colour("mid-grey") !default;
146
-
147
- // =============================================================================
148
- // Links
149
- // =============================================================================
150
-
151
- /// Link colour
152
- ///
153
- /// @type Colour
154
- /// @access public
155
-
156
- $govuk-link-colour: govuk-colour("blue") !default;
157
-
158
- /// Visited link colour
159
- ///
160
- /// @type Colour
161
- /// @access public
162
-
163
- $govuk-link-visited-colour: govuk-colour("purple") !default;
164
-
165
- /// Link hover colour
166
- ///
167
- /// @type Colour
168
- /// @access public
169
-
170
- $govuk-link-hover-colour: govuk-colour("dark-blue") !default;
171
-
172
- /// Active link colour
173
- ///
174
- /// @type Colour
175
- /// @access public
176
-
177
- $govuk-link-active-colour: govuk-colour("black") !default;
178
-
179
- // =============================================================================
180
- // Brand refresh
181
- // =============================================================================
182
-
183
- /// Updated template background colour
184
- ///
185
- /// @type Colour
186
- /// @access private
187
- $_govuk-rebrand-template-background-colour: govuk-tint($govuk-brand-colour, 95%);
188
-
189
- /// Border colour for areas on a light-blue background
190
- ///
191
- /// @type Colour
192
- /// @access private
193
- $_govuk-rebrand-border-colour-on-blue-tint-95: govuk-tint($govuk-brand-colour, 50%);
8
+ @import "./colours-functional";
194
9
 
195
10
  /*# sourceMappingURL=_colours-applied.scss.map */
@@ -0,0 +1,366 @@
1
+ ////
2
+ /// @group settings/colours
3
+ ////
4
+
5
+ @import "../helpers/colour";
6
+
7
+ /// Default definitions of the functional colours
8
+ ///
9
+ /// @type Map
10
+ ///
11
+ /// @see {variable} $govuk-functional-colours
12
+ ///
13
+ /// @access public
14
+ $govuk-default-functional-colours: (
15
+ (
16
+ "brand": (
17
+ name: "blue"
18
+ ),
19
+ "text": (
20
+ name: "black"
21
+ ),
22
+ // The background colour of the template. This is intended to be the same
23
+ // as `surface-background` for the purposes of making the Footer and Cookie
24
+ // banner components merge seamlessly with the template.
25
+ "template-background": (
26
+ name: "blue",
27
+ variant: "tint-95"
28
+ ),
29
+ "body-background": (
30
+ name: "white"
31
+ ),
32
+ // Use 'true black' to avoid printers using colour ink to print body text
33
+ "print-text": #000000,
34
+ // Used in for example 'muted' text and help text.
35
+ "secondary-text": (
36
+ name: "black",
37
+ variant: "tint-25"
38
+ ),
39
+ // Used for outline (and background, where appropriate) when interactive
40
+ // elements (links, form controls) have keyboard focus.
41
+ "focus": (
42
+ name: "yellow"
43
+ ),
44
+ // Ensure that the contrast between the text and background colour passes
45
+ // WCAG Level AA contrast requirements.
46
+ "focus-text": (
47
+ name: "black"
48
+ ),
49
+ // Used to highlight error messages and form controls in an error state
50
+ "error": (
51
+ name: "red"
52
+ ),
53
+ // Used to highlight success messages and banners
54
+ "success": (
55
+ name: "green"
56
+ ),
57
+ // Used in for example borders, separators, rules and keylines.
58
+ "border": (
59
+ name: "black",
60
+ variant: "tint-80"
61
+ ),
62
+ // Used for form inputs and controls
63
+ "input-border": (
64
+ name: "black"
65
+ ),
66
+ // Used for hover states on form controls
67
+ "hover": (
68
+ name: "black",
69
+ variant: "tint-80"
70
+ ),
71
+ // Standard links (on white)
72
+ "link": (
73
+ name: "blue",
74
+ variant: "shade-10"
75
+ ),
76
+ "link-visited": (
77
+ name: "purple"
78
+ ),
79
+ "link-hover": (
80
+ name: "blue",
81
+ variant: "shade-50"
82
+ ),
83
+ "link-active": (
84
+ name: "black"
85
+ ),
86
+ // 'Surfaces' are our name for components that have different colour
87
+ // palettes to typical page content. This is the generic surface.
88
+ "surface-background": (
89
+ name: "blue",
90
+ variant: "tint-95"
91
+ ),
92
+ "surface-text": (
93
+ name: "black"
94
+ ),
95
+ "surface-border": (
96
+ name: "blue",
97
+ variant: "tint-50"
98
+ )
99
+ )
100
+ );
101
+
102
+ /// Functional colours for the GOV.UK palette.
103
+ ///
104
+ /// Each functional colour is represented by a name (for example `'brand'`) to
105
+ /// which the map associates either:
106
+ ///
107
+ /// - a Sass colour (like `#1d70b8`)
108
+ /// - a Sass map with a `name` and an optional `variant` properties, referring
109
+ /// to one of the colours in the colour palette (like `(name: 'blue',
110
+ /// variant: 'primary')`). `variant` defaults to `'primary'` if omitted.
111
+ ///
112
+ /// Use the `govuk-functional-colour` function to access these colours.
113
+ ///
114
+ /// Customise functional colours by defining $govuk-functional-colours with a
115
+ /// map of the colours that you want to change before importing GOV.UK Frontend.
116
+ /// These will then be merged with the default colours. You can only redefine
117
+ /// existing colours.
118
+ ///
119
+ /// @example scss – Redefining functional colours by setting them before import
120
+ ///
121
+ /// // These will be merged with the default functional colours
122
+ /// $govuk-functional-colours: (
123
+ /// // set the 'brand' colour to the 'primary' variant of 'purple'
124
+ /// brand: (name: 'purple'),
125
+ /// // set the 'template-background' colour to the 'tint-95' variant of 'purple'
126
+ /// template-background: (name: 'purple', variant: 'tint-95'),
127
+ /// // set the 'text' colour to an arbitrary colour `#221133`
128
+ /// text: #221133
129
+ /// );
130
+ ///
131
+ /// @see {function} govuk-functional-colour
132
+ ///
133
+ /// @type Map
134
+ ///
135
+ /// @access public
136
+ $govuk-functional-colours: $govuk-default-functional-colours !default;
137
+ $govuk-functional-colours: _govuk-define-functional-colours(
138
+ $govuk-functional-colours,
139
+ $defaults: $govuk-default-functional-colours
140
+ );
141
+
142
+ // =============================================================================
143
+ // Legacy variables
144
+ //
145
+ // To help migrate to `govuk-functional-colour`, we're keeping the variables
146
+ // which were previously storing the functional colours. This should reduce
147
+ // breakage as teams upgrade
148
+ // =============================================================================
149
+
150
+ // Because the file may be imported multiple times, subsequent imports will see
151
+ // the legacy variable and warn when they shouldn't so we need to track those
152
+ $_govuk-deprecated-applied-colour-variables: () !default;
153
+
154
+ /// Warn if a given legacy applied colour variable is set
155
+ ///
156
+ /// @param {String} Name of variable to check
157
+ /// @access private
158
+ @mixin _warn-if-applied-colour-variable-set($functional-colour-name) {
159
+ @if not index($_govuk-deprecated-applied-colour-variables, $functional-colour-name) {
160
+ @if variable-exists("govuk-#{$functional-colour-name}-colour") {
161
+ $deprecation-message: "Setting \`$govuk-#{$functional-colour-name}-colour\` no longer has any effect. Use \`$govuk-functional-colours: (#{$functional-colour-name}: <NEW_COLOUR_VALUE>);\` instead.";
162
+
163
+ @include _warning("applied-colour-variables", $deprecation-message);
164
+ }
165
+
166
+ $_govuk-deprecated-applied-colour-variables: append(
167
+ $_govuk-deprecated-applied-colour-variables,
168
+ $functional-colour-name
169
+ ) !global;
170
+ }
171
+ }
172
+
173
+ @include _warn-if-applied-colour-variable-set(brand);
174
+ /// Brand colour
175
+ ///
176
+ /// @type Colour
177
+ /// @access public
178
+ /// @deprecated
179
+ /// Variables for applied colours are deprecated. Please use the `govuk-functional-colour`
180
+ /// function instead: `govuk-functional-colour(brand)`.
181
+ $govuk-brand-colour: govuk-functional-colour(brand);
182
+
183
+ @include _warn-if-applied-colour-variable-set(text);
184
+ /// Text colour
185
+ ///
186
+ /// @type Colour
187
+ /// @access public
188
+ /// @deprecated
189
+ /// Variables for applied colours are deprecated. Please use the `govuk-functional-colour`
190
+ /// function instead: `govuk-functional-colour(text)`.
191
+ $govuk-text-colour: govuk-functional-colour(text);
192
+
193
+ @include _warn-if-applied-colour-variable-set(template-background);
194
+ /// Template background colour
195
+ ///
196
+ /// Used by components that want to give the illusion of extending
197
+ /// the template background (such as the footer and cookie banner).
198
+ ///
199
+ /// @type Colour
200
+ /// @access public
201
+ /// @deprecated
202
+ /// Variables for applied colours are deprecated. Please use the `govuk-functional-colour`
203
+ /// function instead: `govuk-functional-colour(template-background)`.
204
+ $govuk-template-background-colour: govuk-functional-colour(template-background);
205
+
206
+ @include _warn-if-applied-colour-variable-set(body-background);
207
+ /// Body background colour
208
+ ///
209
+ /// @type Colour
210
+ /// @access public
211
+ /// @deprecated
212
+ /// Variables for applied colours are deprecated. Please use the `govuk-functional-colour`
213
+ /// function instead: `govuk-functional-colour(body-background)`.
214
+ $govuk-body-background-colour: govuk-functional-colour(body-background);
215
+
216
+ @include _warn-if-applied-colour-variable-set(print-text);
217
+ /// Text colour for print media
218
+ ///
219
+ /// Use 'true black' to avoid printers using colour ink to print body text
220
+ ///
221
+ /// @type Colour
222
+ /// @access public
223
+ /// @deprecated
224
+ /// Variables for applied colours are deprecated. Please use the `govuk-functional-colour`
225
+ /// function instead: `govuk-functional-colour(print-text)`.
226
+ $govuk-print-text-colour: govuk-functional-colour(print-text);
227
+
228
+ @include _warn-if-applied-colour-variable-set(secondary-text);
229
+ /// Secondary text colour
230
+ ///
231
+ /// Used in for example 'muted' text and help text.
232
+ ///
233
+ /// @type Colour
234
+ /// @access public
235
+ /// @deprecated
236
+ /// Variables for applied colours are deprecated. Please use the `govuk-functional-colour`
237
+ /// function instead: `govuk-functional-colour(secondary-text)`.
238
+ $govuk-secondary-text-colour: govuk-functional-colour(secondary-text);
239
+
240
+ @include _warn-if-applied-colour-variable-set(focus);
241
+ /// Focus colour
242
+ ///
243
+ /// Used for outline (and background, where appropriate) when interactive
244
+ /// elements (links, form controls) have keyboard focus.
245
+ ///
246
+ /// @type Colour
247
+ /// @access public
248
+ /// @deprecated
249
+ /// Variables for applied colours are deprecated. Please use the `govuk-functional-colour`
250
+ /// function instead: `govuk-functional-colour(focus)`.
251
+ $govuk-focus-colour: govuk-functional-colour(focus);
252
+
253
+ @include _warn-if-applied-colour-variable-set(focus-text);
254
+ /// Focused text colour
255
+ ///
256
+ /// Ensure that the contrast between the text and background colour passes
257
+ /// WCAG Level AA contrast requirements.
258
+ ///
259
+ /// @type Colour
260
+ /// @access public
261
+ /// @deprecated
262
+ /// Variables for applied colours are deprecated. Please use the `govuk-functional-colour`
263
+ /// function instead: `govuk-functional-colour(focus-text)`.
264
+ $govuk-focus-text-colour: govuk-functional-colour(focus-text);
265
+
266
+ @include _warn-if-applied-colour-variable-set(error);
267
+ /// Error colour
268
+ ///
269
+ /// Used to highlight error messages and form controls in an error state
270
+ ///
271
+ /// @type Colour
272
+ /// @access public
273
+ /// @deprecated
274
+ /// Variables for applied colours are deprecated. Please use the `govuk-functional-colour`
275
+ /// function instead: `govuk-functional-colour(error)`.
276
+ $govuk-error-colour: govuk-functional-colour(error);
277
+
278
+ @include _warn-if-applied-colour-variable-set(success);
279
+ /// Success colour
280
+ ///
281
+ /// Used to highlight success messages and banners
282
+ ///
283
+ /// @type Colour
284
+ /// @access public
285
+ /// @deprecated
286
+ /// Variables for applied colours are deprecated. Please use the `govuk-functional-colour`
287
+ /// function instead: `govuk-functional-colour(error)`.
288
+ $govuk-success-colour: govuk-functional-colour(success);
289
+
290
+ @include _warn-if-applied-colour-variable-set(border);
291
+ /// Border colour
292
+ ///
293
+ /// Used in for example borders, separators, rules and keylines.
294
+ ///
295
+ /// @type Colour
296
+ /// @access public
297
+ /// @deprecated
298
+ /// Variables for applied colours are deprecated. Please use the `govuk-functional-colour`
299
+ /// function instead: `govuk-functional-colour(border)`.
300
+ $govuk-border-colour: govuk-functional-colour(border);
301
+
302
+ @include _warn-if-applied-colour-variable-set(input-border);
303
+ /// Input border colour
304
+ ///
305
+ /// Used for form inputs and controls
306
+ ///
307
+ /// @type Colour
308
+ /// @access public
309
+ /// @deprecated
310
+ /// Variables for applied colours are deprecated. Please use the `govuk-functional-colour`
311
+ /// function instead: `govuk-functional-colour(input-border)`.
312
+ $govuk-input-border-colour: govuk-functional-colour(input-border);
313
+
314
+ @include _warn-if-applied-colour-variable-set(hover);
315
+ /// Input hover colour
316
+ ///
317
+ /// Used for hover states on form controls
318
+ ///
319
+ /// @type Colour
320
+ /// @access public
321
+ /// @deprecated
322
+ /// Variables for applied colours are deprecated. Please use the `govuk-functional-colour`
323
+ /// function instead: `govuk-functional-colour(hover)`.
324
+ $govuk-hover-colour: govuk-functional-colour(hover);
325
+
326
+ @include _warn-if-applied-colour-variable-set(link);
327
+ /// Link colour
328
+ ///
329
+ /// @type Colour
330
+ /// @access public
331
+ /// @deprecated
332
+ /// Variables for applied colours are deprecated. Please use the `govuk-functional-colour`
333
+ /// function instead: `govuk-functional-colour(link)`.
334
+ $govuk-link-colour: govuk-functional-colour(link);
335
+
336
+ @include _warn-if-applied-colour-variable-set(link-visited);
337
+ /// Visited link colour
338
+ ///
339
+ /// @type Colour
340
+ /// @access public
341
+ /// @deprecated
342
+ /// Variables for applied colours are deprecated. Please use the `govuk-functional-colour`
343
+ /// function instead: `govuk-functional-colour(link-visited)`.
344
+ $govuk-link-visited-colour: govuk-functional-colour(link-visited);
345
+
346
+ @include _warn-if-applied-colour-variable-set(link-hover);
347
+ /// Link hover colour
348
+ ///
349
+ /// @type Colour
350
+ /// @access public
351
+ /// @deprecated
352
+ /// Variables for applied colours are deprecated. Please use the `govuk-functional-colour`
353
+ /// function instead: `govuk-functional-colour(link-hover)`.
354
+ $govuk-link-hover-colour: govuk-functional-colour(link-hover);
355
+
356
+ @include _warn-if-applied-colour-variable-set(link-active);
357
+ /// Active link colour
358
+ ///
359
+ /// @type Colour
360
+ /// @access public
361
+ /// @deprecated
362
+ /// Variables for applied colours are deprecated. Please use the `govuk-functional-colour`
363
+ /// function instead: `govuk-functional-colour(link-active)`.
364
+ $govuk-link-active-colour: govuk-functional-colour(link-active);
365
+
366
+ /*# sourceMappingURL=_colours-functional.scss.map */