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
@@ -15,23 +15,16 @@
15
15
  // to dark backgrounds in Firefox (https://bugzil.la/1335476). As
16
16
  // background-color and color need to always be set together, color should
17
17
  // not be set either
18
- border: $govuk-border-width-form-element solid $govuk-input-border-colour;
18
+ border: $govuk-border-width-form-element solid;
19
19
  border-radius: 0;
20
+ border-color: govuk-functional-colour(input-border);
20
21
 
21
22
  // Disable inner shadow and remove rounded corners
22
23
  -webkit-appearance: none;
23
24
  appearance: none;
24
25
 
25
26
  &:focus {
26
- outline: $govuk-focus-width solid $govuk-focus-colour;
27
- // Ensure outline appears outside of the element
28
- outline-offset: 0;
29
- // Double the border by adding its width again. Use `box-shadow` for this
30
- // instead of changing `border-width` - this is for consistency with
31
- // components such as textarea where we avoid changing `border-width` as
32
- // it will change the element size. Also, `outline` cannot be utilised
33
- // here as it is already used for the yellow focus state.
34
- box-shadow: inset 0 0 0 $govuk-border-width-form-element;
27
+ @include govuk-focused-form-input;
35
28
  }
36
29
 
37
30
  &:disabled {
@@ -53,10 +46,10 @@
53
46
  }
54
47
 
55
48
  .govuk-input--error {
56
- border-color: $govuk-error-colour;
49
+ border-color: govuk-functional-colour(error);
57
50
 
58
51
  &:focus {
59
- border-color: $govuk-input-border-colour;
52
+ border-color: govuk-functional-colour(input-border);
60
53
  }
61
54
  }
62
55
 
@@ -109,7 +102,7 @@
109
102
  }
110
103
 
111
104
  // Split prefix/suffix onto separate lines on narrow screens
112
- @include govuk-media-query($until: mobile) {
105
+ @media #{govuk-until-breakpoint(mobile)} {
113
106
  display: block;
114
107
 
115
108
  .govuk-input {
@@ -130,15 +123,16 @@
130
123
  min-width: govuk-px-to-rem(40px);
131
124
  height: govuk-px-to-rem(40px);
132
125
  padding: govuk-spacing(1);
133
- border: $govuk-border-width-form-element solid $govuk-input-border-colour;
134
- background-color: govuk-colour("light-grey");
126
+ border: $govuk-border-width-form-element solid;
127
+ border-color: govuk-functional-colour(input-border);
128
+ background-color: govuk-colour("black", $variant: "tint-95");
135
129
  text-align: center;
136
130
  white-space: nowrap;
137
131
  // Emphasise non-editable status of prefixes and suffixes
138
132
  cursor: default;
139
133
  flex: 0 0 auto;
140
134
  // Split prefix/suffix onto separate lines on narrow screens
141
- @include govuk-media-query($until: mobile) {
135
+ @media #{govuk-until-breakpoint(mobile)} {
142
136
  display: block;
143
137
  height: 100%;
144
138
  white-space: normal;
@@ -146,20 +140,20 @@
146
140
  }
147
141
 
148
142
  .govuk-input__prefix {
149
- @include govuk-media-query($until: mobile) {
143
+ @media #{govuk-until-breakpoint(mobile)} {
150
144
  border-bottom: 0;
151
145
  }
152
- @include govuk-media-query($from: mobile) {
146
+ @media #{govuk-from-breakpoint(mobile)} {
153
147
  border-right: 0;
154
148
  }
155
149
  }
156
150
 
157
151
  // Split prefix/suffix onto separate lines on narrow screens
158
152
  .govuk-input__suffix {
159
- @include govuk-media-query($until: mobile) {
153
+ @media #{govuk-until-breakpoint(mobile)} {
160
154
  border-top: 0;
161
155
  }
162
- @include govuk-media-query($from: mobile) {
156
+ @media #{govuk-from-breakpoint(mobile)} {
163
157
  border-left: 0;
164
158
  }
165
159
  }
@@ -10,7 +10,8 @@
10
10
 
11
11
  clear: both;
12
12
 
13
- border-left: $govuk-border-width-wide solid $govuk-border-colour;
13
+ border-left: $govuk-border-width-wide solid;
14
+ border-left-color: govuk-functional-colour(border);
14
15
 
15
16
  > :first-child {
16
17
  margin-top: 0;
@@ -3,12 +3,14 @@
3
3
  @include govuk-font($size: 19);
4
4
  @include govuk-responsive-margin(8, "bottom");
5
5
 
6
- border: $govuk-border-width solid $govuk-brand-colour;
6
+ border: $govuk-border-width solid;
7
+ border-color: govuk-functional-colour(brand);
7
8
 
8
- background-color: $govuk-brand-colour;
9
+ background-color: govuk-functional-colour(brand);
9
10
 
10
11
  &:focus {
11
- outline: $govuk-focus-width solid $govuk-focus-colour;
12
+ outline: $govuk-focus-width solid;
13
+ outline-color: govuk-functional-colour(focus);
12
14
  }
13
15
  }
14
16
 
@@ -19,7 +21,7 @@
19
21
  // text in high contrast mode
20
22
  border-bottom: 1px solid transparent;
21
23
 
22
- @include govuk-media-query($from: tablet) {
24
+ @media #{govuk-from-breakpoint(tablet)} {
23
25
  padding: 2px govuk-spacing(4) govuk-spacing(1);
24
26
  }
25
27
  }
@@ -39,9 +41,9 @@
39
41
  @include govuk-text-colour;
40
42
  padding: govuk-spacing(3);
41
43
 
42
- background-color: $govuk-body-background-colour;
44
+ background-color: govuk-functional-colour(body-background);
43
45
 
44
- @include govuk-media-query($from: tablet) {
46
+ @media #{govuk-from-breakpoint(tablet)} {
45
47
  padding: $padding-tablet;
46
48
  }
47
49
 
@@ -80,9 +82,9 @@
80
82
  }
81
83
 
82
84
  .govuk-notification-banner--success {
83
- border-color: $govuk-success-colour;
85
+ border-color: govuk-functional-colour(success);
84
86
 
85
- background-color: $govuk-success-colour;
87
+ background-color: govuk-functional-colour(success);
86
88
 
87
89
  .govuk-notification-banner__link {
88
90
  @include govuk-link-style-success;
@@ -8,7 +8,7 @@
8
8
  align-items: center;
9
9
  flex-wrap: wrap;
10
10
 
11
- @include govuk-media-query($from: tablet) {
11
+ @media #{govuk-from-breakpoint(tablet)} {
12
12
  flex-direction: row;
13
13
  align-items: flex-start;
14
14
  }
@@ -32,7 +32,7 @@
32
32
  float: left; // Float is ignored if flex is active for prev/next links
33
33
 
34
34
  &:hover {
35
- background-color: govuk-colour("light-grey");
35
+ background-color: govuk-colour("black", $variant: "tint-95");
36
36
  }
37
37
  }
38
38
 
@@ -45,7 +45,7 @@
45
45
  // visually sit in the middle of their touch area
46
46
  text-align: center;
47
47
 
48
- @include govuk-media-query($from: tablet) {
48
+ @media #{govuk-from-breakpoint(tablet)} {
49
49
  display: block;
50
50
  }
51
51
  }
@@ -72,7 +72,7 @@
72
72
 
73
73
  // Only show first, last and non-link items on mobile
74
74
  .govuk-pagination__item--current,
75
- .govuk-pagination__item--ellipses,
75
+ .govuk-pagination__item--ellipsis,
76
76
  .govuk-pagination__item:first-child,
77
77
  .govuk-pagination__item:last-child {
78
78
  display: block;
@@ -81,10 +81,10 @@
81
81
  .govuk-pagination__item--current {
82
82
  @include govuk-typography-weight-bold;
83
83
  outline: 1px solid transparent;
84
- background-color: $govuk-link-colour;
84
+ background-color: govuk-functional-colour(link);
85
85
 
86
86
  &:hover {
87
- background-color: $govuk-link-colour;
87
+ background-color: govuk-functional-colour(link);
88
88
  }
89
89
 
90
90
  .govuk-pagination__link {
@@ -92,9 +92,9 @@
92
92
  }
93
93
  }
94
94
 
95
- .govuk-pagination__item--ellipses {
95
+ .govuk-pagination__item--ellipsis {
96
96
  @include govuk-typography-weight-bold;
97
- color: $govuk-secondary-text-colour;
97
+ color: govuk-functional-colour(secondary-text);
98
98
 
99
99
  // Remove hover state for ellipsis items as they don't contain links
100
100
  &:hover {
@@ -134,7 +134,7 @@
134
134
 
135
135
  &:focus {
136
136
  .govuk-pagination__icon {
137
- color: $govuk-focus-text-colour;
137
+ color: govuk-functional-colour(focus-text);
138
138
  }
139
139
 
140
140
  .govuk-pagination__link-label {
@@ -161,7 +161,7 @@
161
161
  // Set size using rems to make the icon scale with text
162
162
  width: govuk-px-to-rem(15px);
163
163
  height: govuk-px-to-rem(13px);
164
- color: $govuk-secondary-text-colour;
164
+ color: govuk-functional-colour(secondary-text);
165
165
  fill: currentcolor;
166
166
  forced-color-adjust: auto;
167
167
  }
@@ -194,7 +194,8 @@
194
194
 
195
195
  // Only apply a border between prev and next if both are present
196
196
  .govuk-pagination__prev + .govuk-pagination__next {
197
- border-top: 1px solid $govuk-border-colour;
197
+ border-top: 1px solid;
198
+ border-top-color: govuk-functional-colour(border);
198
199
  }
199
200
 
200
201
  // Set the after pseudo element to a block which makes the title visually
@@ -11,8 +11,8 @@
11
11
 
12
12
  text-align: center;
13
13
 
14
- @include govuk-media-query($until: tablet) {
15
- padding: govuk-spacing(if($govuk-new-typography-scale, 4, 3)) - $govuk-border-width;
14
+ @media #{govuk-until-breakpoint(tablet)} {
15
+ padding: govuk-spacing(4) - $govuk-border-width;
16
16
 
17
17
  // This is an if-all-else-fails attempt to stop long words from
18
18
  // overflowing the container on very narrow viewports by forcing them to
@@ -36,9 +36,9 @@
36
36
  color: govuk-colour("white");
37
37
  background: govuk-colour("green");
38
38
 
39
- @include govuk-media-query($media-type: print) {
39
+ @media print {
40
40
  border-color: currentcolor;
41
- color: $govuk-print-text-colour;
41
+ color: govuk-functional-colour(print-text);
42
42
  background: none;
43
43
  }
44
44
  }
@@ -8,7 +8,7 @@
8
8
  // breakpoint
9
9
  // - being display: flex above the mobile breakpoint
10
10
 
11
- @include govuk-media-query($from: mobile) {
11
+ @media #{govuk-from-breakpoint(mobile)} {
12
12
  flex-direction: row;
13
13
 
14
14
  // The default of `stretch` makes the toggle button appear taller than the
@@ -41,7 +41,7 @@
41
41
  display: none;
42
42
  }
43
43
 
44
- @include govuk-media-query($from: mobile) {
44
+ @media #{govuk-from-breakpoint(mobile)} {
45
45
  // Buttons are normally 100% wide on mobile, but we don't want that here
46
46
  width: auto;
47
47
  flex-shrink: 0;
@@ -353,7 +353,7 @@
353
353
  return 'other';
354
354
  }
355
355
  const translation = this.translations[lookupKey];
356
- const preferredForm = this.hasIntlPluralRulesSupport() ? new Intl.PluralRules(this.locale).select(count) : this.selectPluralFormUsingFallbackRules(count);
356
+ const preferredForm = this.hasIntlPluralRulesSupport() ? new Intl.PluralRules(this.locale).select(count) : 'other';
357
357
  if (isObject(translation)) {
358
358
  if (preferredForm in translation) {
359
359
  return preferredForm;
@@ -364,132 +364,7 @@
364
364
  }
365
365
  throw new Error(`i18n: Plural form ".other" is required for "${this.locale}" locale`);
366
366
  }
367
- selectPluralFormUsingFallbackRules(count) {
368
- count = Math.abs(Math.floor(count));
369
- const ruleset = this.getPluralRulesForLocale();
370
- if (ruleset) {
371
- return I18n.pluralRules[ruleset](count);
372
- }
373
- return 'other';
374
- }
375
- getPluralRulesForLocale() {
376
- const localeShort = this.locale.split('-')[0];
377
- for (const pluralRule in I18n.pluralRulesMap) {
378
- const languages = I18n.pluralRulesMap[pluralRule];
379
- if (languages.includes(this.locale) || languages.includes(localeShort)) {
380
- return pluralRule;
381
- }
382
- }
383
- }
384
367
  }
385
- I18n.pluralRulesMap = {
386
- arabic: ['ar'],
387
- chinese: ['my', 'zh', 'id', 'ja', 'jv', 'ko', 'ms', 'th', 'vi'],
388
- french: ['hy', 'bn', 'fr', 'gu', 'hi', 'fa', 'pa', 'zu'],
389
- german: ['af', 'sq', 'az', 'eu', 'bg', 'ca', 'da', 'nl', 'en', 'et', 'fi', 'ka', 'de', 'el', 'hu', 'lb', 'no', 'so', 'sw', 'sv', 'ta', 'te', 'tr', 'ur'],
390
- irish: ['ga'],
391
- russian: ['ru', 'uk'],
392
- scottish: ['gd'],
393
- spanish: ['pt-PT', 'it', 'es'],
394
- welsh: ['cy']
395
- };
396
- I18n.pluralRules = {
397
- arabic(n) {
398
- if (n === 0) {
399
- return 'zero';
400
- }
401
- if (n === 1) {
402
- return 'one';
403
- }
404
- if (n === 2) {
405
- return 'two';
406
- }
407
- if (n % 100 >= 3 && n % 100 <= 10) {
408
- return 'few';
409
- }
410
- if (n % 100 >= 11 && n % 100 <= 99) {
411
- return 'many';
412
- }
413
- return 'other';
414
- },
415
- chinese() {
416
- return 'other';
417
- },
418
- french(n) {
419
- return n === 0 || n === 1 ? 'one' : 'other';
420
- },
421
- german(n) {
422
- return n === 1 ? 'one' : 'other';
423
- },
424
- irish(n) {
425
- if (n === 1) {
426
- return 'one';
427
- }
428
- if (n === 2) {
429
- return 'two';
430
- }
431
- if (n >= 3 && n <= 6) {
432
- return 'few';
433
- }
434
- if (n >= 7 && n <= 10) {
435
- return 'many';
436
- }
437
- return 'other';
438
- },
439
- russian(n) {
440
- const lastTwo = n % 100;
441
- const last = lastTwo % 10;
442
- if (last === 1 && lastTwo !== 11) {
443
- return 'one';
444
- }
445
- if (last >= 2 && last <= 4 && !(lastTwo >= 12 && lastTwo <= 14)) {
446
- return 'few';
447
- }
448
- if (last === 0 || last >= 5 && last <= 9 || lastTwo >= 11 && lastTwo <= 14) {
449
- return 'many';
450
- }
451
- return 'other';
452
- },
453
- scottish(n) {
454
- if (n === 1 || n === 11) {
455
- return 'one';
456
- }
457
- if (n === 2 || n === 12) {
458
- return 'two';
459
- }
460
- if (n >= 3 && n <= 10 || n >= 13 && n <= 19) {
461
- return 'few';
462
- }
463
- return 'other';
464
- },
465
- spanish(n) {
466
- if (n === 1) {
467
- return 'one';
468
- }
469
- if (n % 1000000 === 0 && n !== 0) {
470
- return 'many';
471
- }
472
- return 'other';
473
- },
474
- welsh(n) {
475
- if (n === 0) {
476
- return 'zero';
477
- }
478
- if (n === 1) {
479
- return 'one';
480
- }
481
- if (n === 2) {
482
- return 'two';
483
- }
484
- if (n === 3) {
485
- return 'few';
486
- }
487
- if (n === 6) {
488
- return 'many';
489
- }
490
- return 'other';
491
- }
492
- };
493
368
 
494
369
  /**
495
370
  * Password input component
@@ -347,7 +347,7 @@ class I18n {
347
347
  return 'other';
348
348
  }
349
349
  const translation = this.translations[lookupKey];
350
- const preferredForm = this.hasIntlPluralRulesSupport() ? new Intl.PluralRules(this.locale).select(count) : this.selectPluralFormUsingFallbackRules(count);
350
+ const preferredForm = this.hasIntlPluralRulesSupport() ? new Intl.PluralRules(this.locale).select(count) : 'other';
351
351
  if (isObject(translation)) {
352
352
  if (preferredForm in translation) {
353
353
  return preferredForm;
@@ -358,132 +358,7 @@ class I18n {
358
358
  }
359
359
  throw new Error(`i18n: Plural form ".other" is required for "${this.locale}" locale`);
360
360
  }
361
- selectPluralFormUsingFallbackRules(count) {
362
- count = Math.abs(Math.floor(count));
363
- const ruleset = this.getPluralRulesForLocale();
364
- if (ruleset) {
365
- return I18n.pluralRules[ruleset](count);
366
- }
367
- return 'other';
368
- }
369
- getPluralRulesForLocale() {
370
- const localeShort = this.locale.split('-')[0];
371
- for (const pluralRule in I18n.pluralRulesMap) {
372
- const languages = I18n.pluralRulesMap[pluralRule];
373
- if (languages.includes(this.locale) || languages.includes(localeShort)) {
374
- return pluralRule;
375
- }
376
- }
377
- }
378
361
  }
379
- I18n.pluralRulesMap = {
380
- arabic: ['ar'],
381
- chinese: ['my', 'zh', 'id', 'ja', 'jv', 'ko', 'ms', 'th', 'vi'],
382
- french: ['hy', 'bn', 'fr', 'gu', 'hi', 'fa', 'pa', 'zu'],
383
- german: ['af', 'sq', 'az', 'eu', 'bg', 'ca', 'da', 'nl', 'en', 'et', 'fi', 'ka', 'de', 'el', 'hu', 'lb', 'no', 'so', 'sw', 'sv', 'ta', 'te', 'tr', 'ur'],
384
- irish: ['ga'],
385
- russian: ['ru', 'uk'],
386
- scottish: ['gd'],
387
- spanish: ['pt-PT', 'it', 'es'],
388
- welsh: ['cy']
389
- };
390
- I18n.pluralRules = {
391
- arabic(n) {
392
- if (n === 0) {
393
- return 'zero';
394
- }
395
- if (n === 1) {
396
- return 'one';
397
- }
398
- if (n === 2) {
399
- return 'two';
400
- }
401
- if (n % 100 >= 3 && n % 100 <= 10) {
402
- return 'few';
403
- }
404
- if (n % 100 >= 11 && n % 100 <= 99) {
405
- return 'many';
406
- }
407
- return 'other';
408
- },
409
- chinese() {
410
- return 'other';
411
- },
412
- french(n) {
413
- return n === 0 || n === 1 ? 'one' : 'other';
414
- },
415
- german(n) {
416
- return n === 1 ? 'one' : 'other';
417
- },
418
- irish(n) {
419
- if (n === 1) {
420
- return 'one';
421
- }
422
- if (n === 2) {
423
- return 'two';
424
- }
425
- if (n >= 3 && n <= 6) {
426
- return 'few';
427
- }
428
- if (n >= 7 && n <= 10) {
429
- return 'many';
430
- }
431
- return 'other';
432
- },
433
- russian(n) {
434
- const lastTwo = n % 100;
435
- const last = lastTwo % 10;
436
- if (last === 1 && lastTwo !== 11) {
437
- return 'one';
438
- }
439
- if (last >= 2 && last <= 4 && !(lastTwo >= 12 && lastTwo <= 14)) {
440
- return 'few';
441
- }
442
- if (last === 0 || last >= 5 && last <= 9 || lastTwo >= 11 && lastTwo <= 14) {
443
- return 'many';
444
- }
445
- return 'other';
446
- },
447
- scottish(n) {
448
- if (n === 1 || n === 11) {
449
- return 'one';
450
- }
451
- if (n === 2 || n === 12) {
452
- return 'two';
453
- }
454
- if (n >= 3 && n <= 10 || n >= 13 && n <= 19) {
455
- return 'few';
456
- }
457
- return 'other';
458
- },
459
- spanish(n) {
460
- if (n === 1) {
461
- return 'one';
462
- }
463
- if (n % 1000000 === 0 && n !== 0) {
464
- return 'many';
465
- }
466
- return 'other';
467
- },
468
- welsh(n) {
469
- if (n === 0) {
470
- return 'zero';
471
- }
472
- if (n === 1) {
473
- return 'one';
474
- }
475
- if (n === 2) {
476
- return 'two';
477
- }
478
- if (n === 3) {
479
- return 'few';
480
- }
481
- if (n === 6) {
482
- return 'many';
483
- }
484
- return 'other';
485
- }
486
- };
487
362
 
488
363
  /**
489
364
  * Password input component
@@ -5,7 +5,15 @@
5
5
  padding-top: govuk-spacing(2);
6
6
  padding-bottom: govuk-spacing(2);
7
7
 
8
- border-bottom: 1px solid $govuk-border-colour;
8
+ border-bottom: 1px solid;
9
+ border-bottom-color: govuk-functional-colour(border);
10
+ }
11
+
12
+ // If the phase banner is already contained within a .govuk-width-container,
13
+ // don't double up the left and right margins on narrow viewports.
14
+ .govuk-width-container .govuk-phase-banner.govuk-width-container {
15
+ margin-right: 0;
16
+ margin-left: 0;
9
17
  }
10
18
 
11
19
  .govuk-phase-banner__content {
@@ -18,12 +26,10 @@
18
26
 
19
27
  .govuk-phase-banner__content__tag {
20
28
  @include govuk-font-size($size: 16);
21
- margin-right: govuk-spacing(if($govuk-new-typography-scale, 3, 2));
29
+ margin-right: govuk-spacing(3);
22
30
 
23
- @if $govuk-new-typography-scale {
24
- @include govuk-media-query($from: tablet) {
25
- margin-right: govuk-spacing(2);
26
- }
31
+ @media #{govuk-from-breakpoint(tablet)} {
32
+ margin-right: govuk-spacing(2);
27
33
  }
28
34
  }
29
35
 
@@ -121,7 +121,7 @@
121
121
  outline-color: Highlight;
122
122
  }
123
123
 
124
- box-shadow: 0 0 0 $govuk-radios-focus-width $govuk-focus-colour;
124
+ box-shadow: 0 0 0 $govuk-radios-focus-width govuk-functional-colour(focus);
125
125
  }
126
126
 
127
127
  // Selected state
@@ -145,7 +145,7 @@
145
145
  // =========================================================
146
146
 
147
147
  .govuk-radios--inline {
148
- @include govuk-media-query($from: tablet) {
148
+ @media #{govuk-from-breakpoint(tablet)} {
149
149
  display: flex;
150
150
  flex-wrap: wrap;
151
151
  align-items: flex-start;
@@ -188,7 +188,8 @@
188
188
  @include govuk-responsive-margin(4, "bottom");
189
189
  margin-left: $conditional-margin-left;
190
190
  padding-left: $conditional-padding-left;
191
- border-left: $conditional-border-width solid $govuk-border-colour;
191
+ border-left: $conditional-border-width solid;
192
+ border-left-color: govuk-functional-colour(border);
192
193
 
193
194
  .govuk-frontend-supported &--hidden {
194
195
  display: none;
@@ -288,7 +289,7 @@
288
289
  // Apply an outline for those modes to use instead.
289
290
  outline: $govuk-radios-focus-width dashed transparent;
290
291
  outline-offset: 1px;
291
- box-shadow: 0 0 0 $govuk-hover-width $govuk-hover-colour;
292
+ box-shadow: 0 0 0 $govuk-hover-width govuk-functional-colour(hover);
292
293
  }
293
294
 
294
295
  // Because we've overridden the border-shadow provided by the focus state,
@@ -303,8 +304,8 @@
303
304
  }
304
305
  // prettier-ignore
305
306
  box-shadow:
306
- 0 0 0 $govuk-radios-focus-width $govuk-focus-colour // 1,
307
- 0 0 0 $govuk-hover-width $govuk-hover-colour; // 2
307
+ 0 0 0 $govuk-radios-focus-width govuk-functional-colour(focus), // 1
308
+ 0 0 0 $govuk-hover-width govuk-functional-colour(hover); // 2
308
309
  }
309
310
 
310
311
  // For devices that explicitly don't support hover, don't provide a hover
@@ -319,7 +320,7 @@
319
320
  }
320
321
 
321
322
  .govuk-radios__item:hover .govuk-radios__input:focus + .govuk-radios__label::before {
322
- box-shadow: 0 0 0 $govuk-radios-focus-width $govuk-focus-colour;
323
+ box-shadow: 0 0 0 $govuk-radios-focus-width govuk-functional-colour(focus);
323
324
  }
324
325
  }
325
326
  }