govuk_publishing_components 67.1.0 → 68.1.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 (355) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/config/govuk_publishing_components_manifest.js +1 -1
  3. data/app/assets/javascripts/govuk_publishing_components/lib/filter-list.js +29 -4
  4. data/app/assets/stylesheets/component_guide/application.scss +12 -18
  5. data/app/assets/stylesheets/govuk_publishing_components/all-components.scss +2 -0
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +6 -2
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_app-promo-banner.scss +3 -3
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_attachment-link.scss +1 -1
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_attachment.scss +5 -5
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_breadcrumbs.scss +1 -1
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +2 -2
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_cards.scss +6 -6
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_checkboxes.scss +1 -1
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list-with-body.scss +1 -1
  15. data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-guidance.scss +2 -2
  16. data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss +4 -4
  17. data/app/assets/stylesheets/govuk_publishing_components/components/_cross-service-header.scss +14 -14
  18. data/app/assets/stylesheets/govuk_publishing_components/components/_devolved-nations.scss +3 -3
  19. data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +6 -6
  20. data/app/assets/stylesheets/govuk_publishing_components/components/_emergency-banner.scss +3 -6
  21. data/app/assets/stylesheets/govuk_publishing_components/components/_error-alert.scss +3 -3
  22. data/app/assets/stylesheets/govuk_publishing_components/components/_error-summary.scss +1 -1
  23. data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +7 -7
  24. data/app/assets/stylesheets/govuk_publishing_components/components/_figure.scss +1 -1
  25. data/app/assets/stylesheets/govuk_publishing_components/components/_glance-metric.scss +3 -3
  26. data/app/assets/stylesheets/govuk_publishing_components/components/_govspeak-html-publication.scss +3 -3
  27. data/app/assets/stylesheets/govuk_publishing_components/components/_heading.scss +3 -3
  28. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +3 -3
  29. data/app/assets/stylesheets/govuk_publishing_components/components/_intervention.scss +3 -3
  30. data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +2 -2
  31. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-footer.scss +1 -1
  32. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-for-public.scss +1 -1
  33. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +30 -51
  34. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +23 -23
  35. data/app/assets/stylesheets/govuk_publishing_components/components/_lead-paragraph.scss +1 -1
  36. data/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss +2 -2
  37. data/app/assets/stylesheets/govuk_publishing_components/components/_modal-dialogue.scss +3 -3
  38. data/app/assets/stylesheets/govuk_publishing_components/components/_option-select.scss +3 -3
  39. data/app/assets/stylesheets/govuk_publishing_components/components/_organisation-logo.scss +2 -2
  40. data/app/assets/stylesheets/govuk_publishing_components/components/_pagination.scss +1 -1
  41. data/app/assets/stylesheets/govuk_publishing_components/components/_phase-banner.scss +3 -3
  42. data/app/assets/stylesheets/govuk_publishing_components/components/_print-link.scss +6 -6
  43. data/app/assets/stylesheets/govuk_publishing_components/components/_published-dates.scss +1 -1
  44. data/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +1 -1
  45. data/app/assets/stylesheets/govuk_publishing_components/components/_reorderable-list.scss +3 -3
  46. data/app/assets/stylesheets/govuk_publishing_components/components/_search-with-autocomplete.scss +7 -7
  47. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +8 -8
  48. data/app/assets/stylesheets/govuk_publishing_components/components/_secondary-navigation.scss +6 -6
  49. data/app/assets/stylesheets/govuk_publishing_components/components/_select-with-search.scss +15 -15
  50. data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +2 -2
  51. data/app/assets/stylesheets/govuk_publishing_components/components/_signup-link.scss +2 -2
  52. data/app/assets/stylesheets/govuk_publishing_components/components/_single-page-notification-button.scss +6 -6
  53. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss +2 -2
  54. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss +1 -1
  55. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +11 -11
  56. data/app/assets/stylesheets/govuk_publishing_components/components/_sub-navigation-menu.scss +9 -9
  57. data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +5 -5
  58. data/app/assets/stylesheets/govuk_publishing_components/components/_success-alert.scss +3 -3
  59. data/app/assets/stylesheets/govuk_publishing_components/components/_summary-banner.scss +1 -1
  60. data/app/assets/stylesheets/govuk_publishing_components/components/_table.scss +15 -10
  61. data/app/assets/stylesheets/govuk_publishing_components/components/_tag.scss +1 -1
  62. data/app/assets/stylesheets/govuk_publishing_components/components/_translation-nav.scss +3 -3
  63. data/app/assets/stylesheets/govuk_publishing_components/components/_warning-text.scss +3 -3
  64. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +4 -4
  65. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_call-to-action.scss +2 -2
  66. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +1 -1
  67. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_example.scss +1 -1
  68. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_footnotes.scss +4 -4
  69. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_highlight-answer.scss +1 -1
  70. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_images.scss +1 -1
  71. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_information-callout.scss +1 -1
  72. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_media-player.scss +2 -2
  73. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_place.scss +1 -1
  74. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss +2 -2
  75. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss +2 -2
  76. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +1 -1
  77. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_brand-colours.scss +8 -0
  78. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_colours.scss +9 -11
  79. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +3 -3
  80. data/app/assets/stylesheets/govuk_publishing_components/lib/_link.scss +3 -3
  81. data/app/assets/stylesheets/govuk_publishing_components/lib/_print_support.scss +2 -2
  82. data/app/assets/stylesheets/govuk_publishing_components/settings/_custom-properties.scss +9 -0
  83. data/app/assets/stylesheets/govuk_publishing_components/settings/_index.scss +1 -2
  84. data/app/assets/stylesheets/govuk_publishing_components/specific-components.scss +2 -0
  85. data/app/views/govuk_publishing_components/components/_glance_metric.html.erb +1 -1
  86. data/app/views/govuk_publishing_components/components/_layout_for_admin.html.erb +1 -1
  87. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +1 -1
  88. data/app/views/govuk_publishing_components/components/_layout_header.html.erb +14 -36
  89. data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +1 -1
  90. data/app/views/govuk_publishing_components/components/_tag.html.erb +1 -1
  91. data/app/views/govuk_publishing_components/components/docs/layout_header.yml +0 -15
  92. data/app/views/govuk_publishing_components/components/docs/tag.yml +4 -8
  93. data/app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb +4 -13
  94. data/app/views/layouts/govuk_publishing_components/application.html.erb +1 -1
  95. data/config/initializers/assets.rb +1 -1
  96. data/lib/govuk_publishing_components/version.rb +1 -1
  97. data/node_modules/axe-core/README.md +10 -7
  98. data/node_modules/axe-core/axe.d.ts +4 -15
  99. data/node_modules/axe-core/axe.js +4011 -3559
  100. data/node_modules/axe-core/axe.min.js +2 -2
  101. data/node_modules/axe-core/gather-internals.js +1 -1
  102. data/node_modules/axe-core/locales/README.md +2 -2
  103. data/node_modules/axe-core/locales/_template.json +15 -5
  104. data/node_modules/axe-core/locales/sv.json +1147 -0
  105. data/node_modules/axe-core/package.json +65 -73
  106. data/node_modules/axe-core/sri-history.json +4 -0
  107. data/node_modules/govuk-frontend/README.md +1 -1
  108. data/node_modules/govuk-frontend/dist/govuk/_base.scss +1 -0
  109. data/node_modules/govuk-frontend/dist/govuk/_base.scss.map +1 -1
  110. data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +21 -95
  111. data/node_modules/govuk-frontend/dist/govuk/all.bundle.js.map +1 -1
  112. data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +22 -95
  113. data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs.map +1 -1
  114. data/node_modules/govuk-frontend/dist/govuk/all.mjs +0 -1
  115. data/node_modules/govuk-frontend/dist/govuk/all.mjs.map +1 -1
  116. data/node_modules/govuk-frontend/dist/govuk/assets/images/favicon.ico +0 -0
  117. data/node_modules/govuk-frontend/dist/govuk/assets/images/favicon.svg +1 -1
  118. data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-180.png +0 -0
  119. data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-192.png +0 -0
  120. data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-512.png +0 -0
  121. data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-opengraph-image.png +0 -0
  122. data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
  123. data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss +14 -11
  124. data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss.map +1 -1
  125. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js.map +1 -1
  126. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs.map +1 -1
  127. data/node_modules/govuk-frontend/dist/govuk/components/back-link/_index.scss +2 -2
  128. data/node_modules/govuk-frontend/dist/govuk/components/back-link/_index.scss.map +1 -1
  129. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_index.scss +1 -1
  130. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_index.scss.map +1 -1
  131. data/node_modules/govuk-frontend/dist/govuk/components/button/_index.scss +16 -19
  132. data/node_modules/govuk-frontend/dist/govuk/components/button/_index.scss.map +1 -1
  133. data/node_modules/govuk-frontend/dist/govuk/components/button/fixtures.json +7 -95
  134. data/node_modules/govuk-frontend/dist/govuk/components/button/macro-options.json +12 -19
  135. data/node_modules/govuk-frontend/dist/govuk/components/button/template.njk +8 -20
  136. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss +2 -2
  137. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss.map +1 -1
  138. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js +19 -9
  139. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js.map +1 -1
  140. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs +19 -9
  141. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs.map +1 -1
  142. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs +19 -9
  143. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs.map +1 -1
  144. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_index.scss +7 -6
  145. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_index.scss.map +1 -1
  146. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.scss +2 -5
  147. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.scss.map +1 -1
  148. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/fixtures.json +4 -40
  149. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/template-default.html +2 -2
  150. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/template-with-html.html +2 -2
  151. data/node_modules/govuk-frontend/dist/govuk/components/details/_index.scss +6 -4
  152. data/node_modules/govuk-frontend/dist/govuk/components/details/_index.scss.map +1 -1
  153. data/node_modules/govuk-frontend/dist/govuk/components/error-message/_index.scss +1 -1
  154. data/node_modules/govuk-frontend/dist/govuk/components/error-message/_index.scss.map +1 -1
  155. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_index.scss +4 -2
  156. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_index.scss.map +1 -1
  157. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js.map +1 -1
  158. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs.map +1 -1
  159. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss +28 -37
  160. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss.map +1 -1
  161. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js.map +1 -1
  162. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs.map +1 -1
  163. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/fixtures.json +1 -1
  164. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/macro-options.json +0 -7
  165. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/template.njk +0 -1
  166. data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss +18 -23
  167. data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss.map +1 -1
  168. data/node_modules/govuk-frontend/dist/govuk/components/footer/fixtures.json +25 -38
  169. data/node_modules/govuk-frontend/dist/govuk/components/footer/macro-options.json +0 -6
  170. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-default.html +23 -2
  171. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-full-gds-example.html +23 -2
  172. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-three-equal-columns.html +23 -2
  173. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-html-content-licence-and-copyright-notice.html +23 -2
  174. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-meta.html +23 -2
  175. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-text-content-licence-and-copyright-notice.html +23 -2
  176. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-default-width-navigation-one-column.html +23 -2
  177. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-default-width-navigation-two-columns.html +23 -2
  178. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-meta-links-and-meta-content.html +23 -2
  179. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-navigation.html +23 -2
  180. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-no-content-licence.html +23 -2
  181. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-only-custom-meta.html +23 -2
  182. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-only-meta-links.html +23 -2
  183. data/node_modules/govuk-frontend/dist/govuk/components/footer/template.njk +6 -11
  184. data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss +85 -457
  185. data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss.map +1 -1
  186. data/node_modules/govuk-frontend/dist/govuk/components/header/fixtures.json +7 -536
  187. data/node_modules/govuk-frontend/dist/govuk/components/header/macro-options.json +2 -101
  188. data/node_modules/govuk-frontend/dist/govuk/components/header/template-default.html +7 -6
  189. data/node_modules/govuk-frontend/dist/govuk/components/header/template-full-width.html +7 -6
  190. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-product-name.html +7 -6
  191. data/node_modules/govuk-frontend/dist/govuk/components/header/template.njk +4 -50
  192. data/node_modules/govuk-frontend/dist/govuk/components/hint/_index.scss +1 -1
  193. data/node_modules/govuk-frontend/dist/govuk/components/hint/_index.scss.map +1 -1
  194. data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss +7 -5
  195. data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss.map +1 -1
  196. data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_index.scss +2 -1
  197. data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_index.scss.map +1 -1
  198. data/node_modules/govuk-frontend/dist/govuk/components/label/fixtures.json +2 -2
  199. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss +8 -6
  200. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss.map +1 -1
  201. data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss +9 -10
  202. data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss.map +1 -1
  203. data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss +2 -2
  204. data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss.map +1 -1
  205. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js.map +1 -1
  206. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs.map +1 -1
  207. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss +12 -6
  208. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss.map +1 -1
  209. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/fixtures.json +7 -7
  210. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/template-default.html +1 -1
  211. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/template.njk +1 -1
  212. data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss +7 -6
  213. data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss.map +1 -1
  214. data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss +5 -4
  215. data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss.map +1 -1
  216. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss +50 -71
  217. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss.map +1 -1
  218. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/fixtures.json +7 -32
  219. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss +3 -2
  220. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss.map +1 -1
  221. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss +9 -5
  222. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss.map +1 -1
  223. data/node_modules/govuk-frontend/dist/govuk/components/table/_index.scss +7 -8
  224. data/node_modules/govuk-frontend/dist/govuk/components/table/_index.scss.map +1 -1
  225. data/node_modules/govuk-frontend/dist/govuk/components/tabs/_index.scss +8 -5
  226. data/node_modules/govuk-frontend/dist/govuk/components/tabs/_index.scss.map +1 -1
  227. data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.scss +66 -31
  228. data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.scss.map +1 -1
  229. data/node_modules/govuk-frontend/dist/govuk/components/tag/fixtures.json +6 -18
  230. data/node_modules/govuk-frontend/dist/govuk/components/tag/template-pink.html +2 -2
  231. data/node_modules/govuk-frontend/dist/govuk/components/tag/template-turquoise.html +2 -2
  232. data/node_modules/govuk-frontend/dist/govuk/components/task-list/_index.scss +7 -5
  233. data/node_modules/govuk-frontend/dist/govuk/components/task-list/_index.scss.map +1 -1
  234. data/node_modules/govuk-frontend/dist/govuk/components/task-list/fixtures.json +13 -25
  235. data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-with-all-possible-colours.html +12 -24
  236. data/node_modules/govuk-frontend/dist/govuk/components/task-list/template-with-hint-text-and-additional-states.html +2 -2
  237. data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss +4 -3
  238. data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss.map +1 -1
  239. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss +4 -3
  240. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss.map +1 -1
  241. data/node_modules/govuk-frontend/dist/govuk/core/_index.scss +0 -1
  242. data/node_modules/govuk-frontend/dist/govuk/core/_index.scss.map +1 -1
  243. data/node_modules/govuk-frontend/dist/govuk/core/_section-break.scss +2 -1
  244. data/node_modules/govuk-frontend/dist/govuk/core/_section-break.scss.map +1 -1
  245. data/node_modules/govuk-frontend/dist/govuk/core/_typography.scss +3 -17
  246. data/node_modules/govuk-frontend/dist/govuk/core/_typography.scss.map +1 -1
  247. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_breakpoints.scss +17 -0
  248. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_breakpoints.scss.map +1 -0
  249. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_frontend-version.scss +15 -0
  250. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_frontend-version.scss.map +1 -0
  251. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_functional-colours.scss +17 -0
  252. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_functional-colours.scss.map +1 -0
  253. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_index.scss +5 -0
  254. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_index.scss.map +1 -0
  255. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css +2 -2
  256. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css.map +1 -1
  257. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
  258. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js.map +1 -1
  259. data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss +168 -82
  260. data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss.map +1 -1
  261. data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss +8 -7
  262. data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss.map +1 -1
  263. data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss +23 -39
  264. data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss.map +1 -1
  265. data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss +2 -26
  266. data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss.map +1 -1
  267. data/node_modules/govuk-frontend/dist/govuk/i18n.mjs.map +1 -1
  268. data/node_modules/govuk-frontend/dist/govuk/init.mjs +1 -2
  269. data/node_modules/govuk-frontend/dist/govuk/init.mjs.map +1 -1
  270. data/node_modules/govuk-frontend/dist/govuk/macros/logo.njk +4 -26
  271. data/node_modules/govuk-frontend/dist/govuk/objects/_form-group.scss +2 -1
  272. data/node_modules/govuk-frontend/dist/govuk/objects/_form-group.scss.map +1 -1
  273. data/node_modules/govuk-frontend/dist/govuk/objects/_template.scss +2 -6
  274. data/node_modules/govuk-frontend/dist/govuk/objects/_template.scss.map +1 -1
  275. data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.scss +0 -2
  276. data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.scss.map +1 -1
  277. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-applied.scss +3 -188
  278. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-applied.scss.map +1 -1
  279. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-functional.scss +366 -0
  280. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-functional.scss.map +1 -0
  281. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss +8 -254
  282. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss.map +1 -1
  283. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-palette.scss +117 -25
  284. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-palette.scss.map +1 -1
  285. data/node_modules/govuk-frontend/dist/govuk/settings/_custom-properties.scss +18 -0
  286. data/node_modules/govuk-frontend/dist/govuk/settings/_custom-properties.scss.map +1 -0
  287. data/node_modules/govuk-frontend/dist/govuk/settings/_index.scss +3 -14
  288. data/node_modules/govuk-frontend/dist/govuk/settings/_index.scss.map +1 -1
  289. data/node_modules/govuk-frontend/dist/govuk/settings/_media-queries.scss +0 -16
  290. data/node_modules/govuk-frontend/dist/govuk/settings/_media-queries.scss.map +1 -1
  291. data/node_modules/govuk-frontend/dist/govuk/settings/_typography-responsive.scss +12 -189
  292. data/node_modules/govuk-frontend/dist/govuk/settings/_typography-responsive.scss.map +1 -1
  293. data/node_modules/govuk-frontend/dist/govuk/template.njk +61 -23
  294. data/node_modules/govuk-frontend/dist/govuk/tools/_index.scss +0 -1
  295. data/node_modules/govuk-frontend/dist/govuk/tools/_index.scss.map +1 -1
  296. data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-rem.scss +2 -0
  297. data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-rem.scss.map +1 -1
  298. data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +1 -4
  299. data/node_modules/govuk-frontend/package.json +13 -12
  300. metadata +15 -56
  301. data/app/assets/javascripts/govuk_publishing_components/components/layout-header.js +0 -3
  302. data/app/assets/stylesheets/govuk_publishing_components/settings/_colours.scss +0 -5
  303. data/app/assets/stylesheets/govuk_publishing_components/settings/_typography.scss +0 -1
  304. data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +0 -34
  305. data/node_modules/govuk-frontend/dist/govuk/all.scss +0 -9
  306. data/node_modules/govuk-frontend/dist/govuk/all.scss.map +0 -1
  307. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/favicon.ico +0 -0
  308. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/favicon.svg +0 -1
  309. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-crest.svg +0 -1
  310. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-180.png +0 -0
  311. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-192.png +0 -0
  312. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-512.png +0 -0
  313. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-mask.svg +0 -1
  314. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-opengraph-image.png +0 -0
  315. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/manifest.json +0 -39
  316. data/node_modules/govuk-frontend/dist/govuk/components/_all.scss +0 -10
  317. data/node_modules/govuk-frontend/dist/govuk/components/_all.scss.map +0 -1
  318. data/node_modules/govuk-frontend/dist/govuk/components/button/template-input.html +0 -1
  319. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js +0 -238
  320. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js.map +0 -1
  321. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs +0 -230
  322. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs.map +0 -1
  323. data/node_modules/govuk-frontend/dist/govuk/components/header/header.mjs +0 -89
  324. data/node_modules/govuk-frontend/dist/govuk/components/header/header.mjs.map +0 -1
  325. data/node_modules/govuk-frontend/dist/govuk/components/header/template-full-width-with-navigation.html +0 -54
  326. data/node_modules/govuk-frontend/dist/govuk/components/header/template-navigation-item-with-html.html +0 -54
  327. data/node_modules/govuk-frontend/dist/govuk/components/header/template-navigation-item-with-text-without-link.html +0 -48
  328. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-custom-menu-button-text.html +0 -59
  329. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-full-width-border.html +0 -29
  330. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-large-navigation.html +0 -119
  331. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-navigation.html +0 -59
  332. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-service-name-and-navigation.html +0 -62
  333. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-service-name-but-no-service-url.html +0 -34
  334. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-service-name.html +0 -34
  335. data/node_modules/govuk-frontend/dist/govuk/components/header/template-with-st-edwards-crown.html +0 -19
  336. data/node_modules/govuk-frontend/dist/govuk/components/tag/template-light-blue.html +0 -3
  337. data/node_modules/govuk-frontend/dist/govuk/core/_all.scss +0 -10
  338. data/node_modules/govuk-frontend/dist/govuk/core/_all.scss.map +0 -1
  339. data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss +0 -15
  340. data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss.map +0 -1
  341. data/node_modules/govuk-frontend/dist/govuk/helpers/_all.scss +0 -10
  342. data/node_modules/govuk-frontend/dist/govuk/helpers/_all.scss.map +0 -1
  343. data/node_modules/govuk-frontend/dist/govuk/objects/_all.scss +0 -10
  344. data/node_modules/govuk-frontend/dist/govuk/objects/_all.scss.map +0 -1
  345. data/node_modules/govuk-frontend/dist/govuk/overrides/_all.scss +0 -9
  346. data/node_modules/govuk-frontend/dist/govuk/overrides/_all.scss.map +0 -1
  347. data/node_modules/govuk-frontend/dist/govuk/settings/_all.scss +0 -10
  348. data/node_modules/govuk-frontend/dist/govuk/settings/_all.scss.map +0 -1
  349. data/node_modules/govuk-frontend/dist/govuk/tools/_all.scss +0 -10
  350. data/node_modules/govuk-frontend/dist/govuk/tools/_all.scss.map +0 -1
  351. data/node_modules/govuk-frontend/dist/govuk/tools/_rebrand.scss +0 -65
  352. data/node_modules/govuk-frontend/dist/govuk/tools/_rebrand.scss.map +0 -1
  353. data/node_modules/govuk-frontend/dist/govuk/utilities/_all.scss +0 -10
  354. data/node_modules/govuk-frontend/dist/govuk/utilities/_all.scss.map +0 -1
  355. data/node_modules/govuk-frontend/dist/govuk-prototype-kit/functions.js +0 -25
@@ -6,43 +6,184 @@
6
6
  /// @group helpers/colour
7
7
  ////
8
8
 
9
- /// Get colour
9
+ /// Get a colour from the palette
10
+ ///
11
+ /// Before using this function, check if your use case is covered by a
12
+ /// functional colour. For example, use `govuk-functional-colour("link")` for
13
+ /// links rather than `govuk-colour("blue")`.
10
14
  ///
11
15
  /// @param {String | Colour} $colour - Name of colour from the colour palette
12
- /// (`$govuk-colours`)
13
- /// @param {String | Colour | Boolean} $legacy [false] - Deprecated.
14
- /// The `$legacy` parameter is deprecated and is non-operational, as the
15
- /// legacy colour palette has been removed. The parameter will be removed in
16
- /// the next major version.
16
+ /// (`$_govuk-palette`)
17
+ /// @param {String | Colour} $variant - Name of the variant from the colour palette
18
+ /// (`$_govuk-palette`)
17
19
  /// @return {Colour} Representation of named colour
18
20
  ///
21
+ /// @example scss - Getting the primary variant of a colour
22
+ /// .my-component {
23
+ /// color: govuk-colour("blue");
24
+ /// }
25
+ ///
26
+ /// @example scss - Getting a 50% shade of blue
27
+ /// .my-component {
28
+ /// color: govuk-colour("blue", $variant: "shade-50")
29
+ /// }
30
+ ///
19
31
  /// @throw if `$colour` is not a colour from the colour palette
32
+ /// @throw if `$variant` is not a variant of the `$colour` in the colour palette
33
+ /// @throw if the palette is misformatted and doesn't associate a colour or map to `$colour`
20
34
  /// @access public
21
35
 
22
- @function govuk-colour($colour, $legacy: false) {
23
- // Output a warning if $legacy is set to anything.
24
- @if $legacy and _should-warn("legacy-colour-param") {
25
- @warn _warning-text("legacy-colour-param", "The `$legacy` parameter of " +
26
- "`govuk-colour` is deprecated and is non-operational. It will be " +
27
- "removed in the next major version.");
36
+ @function govuk-colour($colour, $variant: primary, $colours: $_govuk-palette) {
37
+ // Sass parses unquoted colours as colours, so we need to turn them into
38
+ // strings before looking them up in the colour palette
39
+ // https://sass-lang.com/documentation/values/strings#unquoted
40
+ @if type-of($colour) != "string" {
41
+ $colour: "#{$colour}";
42
+ }
43
+
44
+ $colour-variants: map-get($colours, $colour);
45
+
46
+ @if not $colour-variants {
47
+ // To ease the transition between the brand palette and old GOV.UK Frontend colours
48
+ // we'll automatically convert old colour names into their equivalent in the palette
49
+ @if $colours == $_govuk-palette {
50
+ $corresponding-colour: _govuk-corresponding-brand-colour($colour);
51
+ @if $corresponding-colour {
52
+ @return $corresponding-colour;
53
+ }
54
+ }
55
+
56
+ @error "Unknown colour `#{$colour}` (available colours: #{map-keys($colours)})";
57
+ }
58
+
59
+ // Some colours may not have variants, if that's the case, we can return the colour straight away
60
+ @if type-of($colour-variants) == "color" {
61
+ @return $colour-variants;
28
62
  }
29
63
 
30
- @if type-of($colour) == "color" {
31
- // stylelint-disable-next-line scss/function-quote-no-quoted-strings-inside
32
- $colour: quote("#{$colour}");
64
+ @if type-of($colour-variants) != "map" {
65
+ @error "Colour `#{$colour}` should either be a `map` or `color`, not a `#{type-of($colour-variants)}`";
33
66
  }
34
67
 
35
- @if not map-has-key($govuk-colours, $colour) {
36
- @error "Unknown colour `#{$colour}`";
68
+ $result: map-get($colour-variants, $variant);
69
+
70
+ @if not $result {
71
+ @error "Unknown variant `#{$variant}` for colour `#{$colour}` (available variants: #{map-keys($colour-variants)})";
37
72
  }
38
73
 
39
- @return map-get($govuk-colours, $colour);
74
+ @return $result;
75
+ }
76
+
77
+ @function _govuk-corresponding-brand-colour($colour) {
78
+ $pre-brand-colour: map-get($_govuk-pre-brand-colours, $colour);
79
+
80
+ @if $pre-brand-colour {
81
+ $corresponding-colour: nth($pre-brand-colour, 1);
82
+ $corresponding-variant: nth($pre-brand-colour, 2);
83
+
84
+ $corresponding-govuk-colour-call: 'govuk-colour("#{$corresponding-colour}", $variant: "#{$corresponding-variant}")';
85
+
86
+ @if _should-warn("pre-brand-colour") {
87
+ @warn _warning-text("pre-brand-colour",
88
+ "We've updated GOV.UK Frontend's colour palette. Use " +
89
+ "`#{$corresponding-govuk-colour-call}` instead of " +
90
+ "`govuk-colour(\"#{$colour}\")`. The `#{$colour}` colour is " +
91
+ "deprecated and we'll remove it in the next major version."
92
+ );
93
+ }
94
+
95
+ @return govuk-colour($corresponding-colour, $variant: $corresponding-variant);
96
+ }
97
+ }
98
+
99
+ /// Get a functional colour
100
+ ///
101
+ /// @param {String|Colour} $colour - Name of the colour from the list of
102
+ /// [functional colours](https://design-system.service.gov.uk/styles/colour/)
103
+ /// @return {String} A reference to the functional colour's custom property
104
+ /// wrapped in a var function, with the functional colour's hex value as a
105
+ /// fallback value.
106
+ ///
107
+ /// @example scss - Getting a functional colour
108
+ /// .branded-element {
109
+ /// color: govuk-functional-colour('brand');
110
+ /// }
111
+ ///
112
+ /// @example css - Output from getting a functional colour
113
+ /// .branded-element {
114
+ /// /* Assuming the 'brand' colour is hotpink */
115
+ /// color: var(--govuk-brand-colour, hotpink);
116
+ /// }
117
+ ///
118
+ /// @throw if `$colour` is not an functional colour of GOV.UK Frontend
119
+ /// @access public
120
+ /// @see $govuk-functional-colours
121
+ @function govuk-functional-colour($colour) {
122
+ // Sass parses unquoted colours as colours, so we need to turn them into
123
+ // strings before looking them up in the colour palette
124
+ // https://sass-lang.com/documentation/values/strings#unquoted
125
+ @if type-of($colour) != "string" {
126
+ $colour: "#{$colour}";
127
+ }
128
+
129
+ @if map-has-key($govuk-functional-colours, $colour) {
130
+ $value: _govuk-resolve-colour(map-get($govuk-functional-colours, $colour));
131
+
132
+ @return var(--govuk-#{$colour}-colour, #{$value});
133
+ }
134
+
135
+ @error "Unknown colour `#{$colour}` (available colours: #{map-keys($govuk-functional-colours)})";
136
+ }
137
+
138
+ /// Resolves the given reference to a colour in the palette
139
+ ///
140
+ /// @param {Map|Colour} $colour-reference - A map with the `name`, and optionally a `variant` for the colour in the palette
141
+ /// @returns {Colour} The colour
142
+ /// @throws if the `name` is present but falsy
143
+ /// @throws if the `variant` is present but falsy
144
+ /// @access private
145
+ @function _govuk-resolve-colour($colour-reference) {
146
+ // If the reference is already a colour, return the colour
147
+ @if type-of($colour-reference) == "color" {
148
+ @return $colour-reference;
149
+ }
150
+
151
+ @if not type-of($colour-reference) == "map" {
152
+ @error 'Colour reference should be a Sass colour or a Sass map';
153
+ }
154
+
155
+ $name: map-get($colour-reference, "name");
156
+ @if not $name or $name == "" {
157
+ @error "Colour reference `name` shouldn't be empty.";
158
+ }
159
+
160
+ $variant: "primary";
161
+ @if map-has-key($colour-reference, "variant") {
162
+ $variant: map-get($colour-reference, "variant");
163
+ }
164
+
165
+ @if not $variant or $variant == "" {
166
+ @error "Colour reference `variant` shouldn't be empty.";
167
+ }
168
+
169
+ @return govuk-colour($name, $variant: $variant);
170
+ }
171
+
172
+ @function _govuk-define-functional-colours($colours, $defaults) {
173
+ $existing-colours: map-keys($defaults);
174
+
175
+ @each $colour-name, $colour in $colours {
176
+ @if not index($existing-colours, $colour-name) {
177
+ @error 'Unknown colour `#{$colour-name}` (available colours: #{$existing-colours})';
178
+ }
179
+ }
180
+
181
+ @return map-merge($defaults, $colours);
40
182
  }
41
183
 
42
184
  /// Get the colour for a government organisation
43
185
  ///
44
186
  /// @param {String} $organisation - Organisation name, lowercase, hyphenated
45
- /// @param {Boolean} $websafe - Deprecated. Use $contrast-safe instead.
46
187
  /// @param {Boolean} $contrast-safe [true] - By default a version of the colour
47
188
  /// will be returned which has a minimum 4.5:1 contrast ratio when used with
48
189
  /// white, as per the WCAG 2.1 Level AA guidelines. If you want to use the
@@ -54,7 +195,7 @@
54
195
  /// @throw if `$organisation` is not a known organisation
55
196
  /// @access public
56
197
 
57
- @function govuk-organisation-colour($organisation, $websafe: null, $contrast-safe: true) {
198
+ @function govuk-organisation-colour($organisation, $contrast-safe: true) {
58
199
  // Check if the $organisation exists in the aliases map. If so, change the
59
200
  // value of $organisation to the aliased value.
60
201
  @if map-has-key($_govuk_colours-organisations-aliases, $organisation) {
@@ -66,79 +207,24 @@
66
207
  @error "Unknown organisation `#{$organisation}`";
67
208
  }
68
209
 
69
- // Output a deprecation warning if the legacy colour palette is being used.
70
- // Remove in next major version.
71
- $is-legacy: $govuk-colours-organisations == $_govuk-legacy-organisation-colours;
72
- @if $is-legacy and _should-warn("legacy-organisation-colours") {
73
- @warn _warning-text("legacy-organisation-colours",
74
- "We've updated the organisation colour palette. Opt in to the new " +
75
- "colours using `$govuk-new-organisation-colours: true`. The old " +
76
- "palette is deprecated and we'll remove it in the next major version."
77
- );
78
- }
79
-
80
- // Output a warning if $websafe is set.
81
- @if $websafe and _should-warn("organisation-colour-websafe-param") {
82
- @warn _warning-text("organisation-colour-websafe-param",
83
- "The `$websafe` parameter of `govuk-organisation-colour` has been " +
84
- "renamed to `$contrast-safe`. The old parameter name will be removed in " +
85
- "the next major version."
86
- );
87
- }
88
-
89
210
  $org-colour: map-get($govuk-colours-organisations, $organisation);
90
211
 
91
- @if map-has-key($org-colour, deprecation-message) and _should-warn("organisation-colours") {
212
+ // If the organisation has a deprecation message associated with it
213
+ // (e.g. it has ceased to exist) then output a warning.
214
+ @if map-has-key($org-colour, "deprecation-message") and _should-warn("organisation-colours") {
92
215
  @warn _warning-text(
93
216
  "organisation-colours",
94
- map-get($org-colour, deprecation-message)
217
+ map-get($org-colour, "deprecation-message")
95
218
  );
96
219
  }
97
220
 
98
- // If the $websafe parameter is being used (it has been explicitly set as true
99
- // or false), assume the user hasn't updated to use $contrast-safe yet and map
100
- // the old parameter's value onto the new parameter.
101
- @if type-of($websafe) != "null" {
102
- $contrast-safe: $websafe;
103
- }
104
-
105
- // Determine the contrast-safe key to use depending on whether it's the new
106
- // palette or the legacy palette
107
- $safe-key: if($govuk-new-organisation-colours, "contrast-safe", "colour-websafe");
108
-
109
- @if $contrast-safe and map-has-key($org-colour, $safe-key) {
110
- @return map-get($org-colour, $safe-key);
221
+ @if $contrast-safe and map-has-key($org-colour, "contrast-safe") {
222
+ @return map-get($org-colour, "contrast-safe");
111
223
  } @else {
112
- @return map-get($org-colour, colour);
224
+ @return map-get($org-colour, "colour");
113
225
  }
114
226
  }
115
227
 
116
- /// Make a colour darker by mixing it with black
117
- ///
118
- /// @param {Colour} $colour - colour to shade
119
- /// @param {Number} $percentage - percentage of black to mix with $colour
120
- /// @return {Colour}
121
- /// @access public
122
-
123
- @function govuk-shade($colour, $percentage) {
124
- // Ensure the output is a hex string so that Safari <12 can render the colour
125
- // without issues from float values in `rgb()`
126
- @return _as-hexadecimal(mix(#000000, $colour, $percentage));
127
- }
128
-
129
- /// Make a colour lighter by mixing it with white
130
- ///
131
- /// @param {Colour} $colour - colour to tint
132
- /// @param {Number} $percentage - percentage of white to mix with $colour
133
- /// @return {Colour}
134
- /// @access public
135
-
136
- @function govuk-tint($colour, $percentage) {
137
- // Ensure the output is a hex string so that Safari <12 can render the colour
138
- // without issues from float values in `rgb()`
139
- @return _as-hexadecimal(mix(govuk-colour("white"), $colour, $percentage));
140
- }
141
-
142
228
  /// Converts a colour with potential float values for its RGB channels
143
229
  /// into hexadecimal notation
144
230
  ///
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/govuk/helpers/_colour.scss"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,2CAA2C;AAC3C,8BAA8B;;AAE9B,GAAG;AACH,wBAAwB;AACxB,GAAG;;AAEH,aAAa;AACb,EAAE;AACF,4EAA4E;AAC5E,uBAAuB;AACvB,mEAAmE;AACnE,yEAAyE;AACzE,6EAA6E;AAC7E,4BAA4B;AAC5B,kDAAkD;AAClD,EAAE;AACF,8DAA8D;AAC9D,iBAAiB;;AAEjB;EACE,iDAAiD;EACjD;IACE;;yCAEqC;EACvC;;EAEA;IACE,0EAA0E;IAC1E,4BAA4B;EAC9B;;EAEA;IACE,oCAAoC;EACtC;;EAEA,wCAAwC;AAC1C;;AAEA,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,sEAAsE;AACtE,8EAA8E;AAC9E,6EAA6E;AAC7E,2EAA2E;AAC3E,0EAA0E;AAC1E,0EAA0E;AAC1E,oEAAoE;AACpE,EAAE;AACF,6DAA6D;AAC7D,wDAAwD;AACxD,iBAAiB;;AAEjB;EACE,yEAAyE;EACzE,8CAA8C;EAC9C;IACE,4EAA4E;EAC9E;;EAEA,yCAAyC;EACzC;IACE,gDAAgD;EAClD;;EAEA,0EAA0E;EAC1E,+BAA+B;EAC/B,+EAA+E;EAC/E;IACE;;;;KAIC;EACH;;EAEA,sCAAsC;EACtC;IACE;;;;KAIC;EACH;;EAEA,iEAAiE;;EAEjE;IACE;;;KAGC;EACH;;EAEA,6EAA6E;EAC7E,6EAA6E;EAC7E,mDAAmD;EACnD;IACE,wBAAwB;EAC1B;;EAEA,0EAA0E;EAC1E,+BAA+B;EAC/B,iFAAiF;;EAEjF;IACE,uCAAuC;EACzC,EAAE;IACA,oCAAoC;EACtC;AACF;;AAEA,+CAA+C;AAC/C,EAAE;AACF,4CAA4C;AAC5C,wEAAwE;AACxE,mBAAmB;AACnB,iBAAiB;;AAEjB;EACE,4EAA4E;EAC5E,6CAA6C;EAC7C,2DAA2D;AAC7D;;AAEA,gDAAgD;AAChD,EAAE;AACF,2CAA2C;AAC3C,wEAAwE;AACxE,mBAAmB;AACnB,iBAAiB;;AAEjB;EACE,4EAA4E;EAC5E,6CAA6C;EAC7C,yEAAyE;AAC3E;;AAEA,qEAAqE;AACrE,4BAA4B;AAC5B,EAAE;AACF,8DAA8D;AAC9D,EAAE;AACF,kDAAkD;AAClD,mBAAmB;AACnB,kBAAkB;AAClB;EACE;IACE,eAAe;EACjB;;EAEA,0EAA0E;EAC1E,qDAAqD;EACrD;;;;;GAKC;;EAED,wCAAwC;AAC1C","file":"_colour.scss","sourcesContent":["@import \"../settings/colours-palette\";\n@import \"../settings/colours-organisations\";\n@import \"../settings/warnings\";\n\n////\n/// @group helpers/colour\n////\n\n/// Get colour\n///\n/// @param {String | Colour} $colour - Name of colour from the colour palette\n/// (`$govuk-colours`)\n/// @param {String | Colour | Boolean} $legacy [false] - Deprecated.\n/// The `$legacy` parameter is deprecated and is non-operational, as the\n/// legacy colour palette has been removed. The parameter will be removed in\n/// the next major version.\n/// @return {Colour} Representation of named colour\n///\n/// @throw if `$colour` is not a colour from the colour palette\n/// @access public\n\n@function govuk-colour($colour, $legacy: false) {\n // Output a warning if $legacy is set to anything.\n @if $legacy and _should-warn(\"legacy-colour-param\") {\n @warn _warning-text(\"legacy-colour-param\", \"The `$legacy` parameter of \" +\n \"`govuk-colour` is deprecated and is non-operational. It will be \" +\n \"removed in the next major version.\");\n }\n\n @if type-of($colour) == \"color\" {\n // stylelint-disable-next-line scss/function-quote-no-quoted-strings-inside\n $colour: quote(\"#{$colour}\");\n }\n\n @if not map-has-key($govuk-colours, $colour) {\n @error \"Unknown colour `#{$colour}`\";\n }\n\n @return map-get($govuk-colours, $colour);\n}\n\n/// Get the colour for a government organisation\n///\n/// @param {String} $organisation - Organisation name, lowercase, hyphenated\n/// @param {Boolean} $websafe - Deprecated. Use $contrast-safe instead.\n/// @param {Boolean} $contrast-safe [true] - By default a version of the colour\n/// will be returned which has a minimum 4.5:1 contrast ratio when used with\n/// white, as per the WCAG 2.1 Level AA guidelines. If you want to use the\n/// non-contrast safe version you can set this to `false` but your should\n/// ensure that you still meets contrast requirements for accessibility -\n/// for example, do not use the non-contrast safe version for text.\n///\n/// @return {Colour} Representation of colour for organisation\n/// @throw if `$organisation` is not a known organisation\n/// @access public\n\n@function govuk-organisation-colour($organisation, $websafe: null, $contrast-safe: true) {\n // Check if the $organisation exists in the aliases map. If so, change the\n // value of $organisation to the aliased value.\n @if map-has-key($_govuk_colours-organisations-aliases, $organisation) {\n $organisation: map-get($_govuk_colours-organisations-aliases, $organisation);\n }\n\n // Check to see if the organisation exists\n @if not map-has-key($govuk-colours-organisations, $organisation) {\n @error \"Unknown organisation `#{$organisation}`\";\n }\n\n // Output a deprecation warning if the legacy colour palette is being used.\n // Remove in next major version.\n $is-legacy: $govuk-colours-organisations == $_govuk-legacy-organisation-colours;\n @if $is-legacy and _should-warn(\"legacy-organisation-colours\") {\n @warn _warning-text(\"legacy-organisation-colours\",\n \"We've updated the organisation colour palette. Opt in to the new \" +\n \"colours using `$govuk-new-organisation-colours: true`. The old \" +\n \"palette is deprecated and we'll remove it in the next major version.\"\n );\n }\n\n // Output a warning if $websafe is set.\n @if $websafe and _should-warn(\"organisation-colour-websafe-param\") {\n @warn _warning-text(\"organisation-colour-websafe-param\",\n \"The `$websafe` parameter of `govuk-organisation-colour` has been \" +\n \"renamed to `$contrast-safe`. The old parameter name will be removed in \" +\n \"the next major version.\"\n );\n }\n\n $org-colour: map-get($govuk-colours-organisations, $organisation);\n\n @if map-has-key($org-colour, deprecation-message) and _should-warn(\"organisation-colours\") {\n @warn _warning-text(\n \"organisation-colours\",\n map-get($org-colour, deprecation-message)\n );\n }\n\n // If the $websafe parameter is being used (it has been explicitly set as true\n // or false), assume the user hasn't updated to use $contrast-safe yet and map\n // the old parameter's value onto the new parameter.\n @if type-of($websafe) != \"null\" {\n $contrast-safe: $websafe;\n }\n\n // Determine the contrast-safe key to use depending on whether it's the new\n // palette or the legacy palette\n $safe-key: if($govuk-new-organisation-colours, \"contrast-safe\", \"colour-websafe\");\n\n @if $contrast-safe and map-has-key($org-colour, $safe-key) {\n @return map-get($org-colour, $safe-key);\n } @else {\n @return map-get($org-colour, colour);\n }\n}\n\n/// Make a colour darker by mixing it with black\n///\n/// @param {Colour} $colour - colour to shade\n/// @param {Number} $percentage - percentage of black to mix with $colour\n/// @return {Colour}\n/// @access public\n\n@function govuk-shade($colour, $percentage) {\n // Ensure the output is a hex string so that Safari <12 can render the colour\n // without issues from float values in `rgb()`\n @return _as-hexadecimal(mix(#000000, $colour, $percentage));\n}\n\n/// Make a colour lighter by mixing it with white\n///\n/// @param {Colour} $colour - colour to tint\n/// @param {Number} $percentage - percentage of white to mix with $colour\n/// @return {Colour}\n/// @access public\n\n@function govuk-tint($colour, $percentage) {\n // Ensure the output is a hex string so that Safari <12 can render the colour\n // without issues from float values in `rgb()`\n @return _as-hexadecimal(mix(govuk-colour(\"white\"), $colour, $percentage));\n}\n\n/// Converts a colour with potential float values for its RGB channels\n/// into hexadecimal notation\n///\n/// This ensures the colour is rendered properly by Safari < 12\n///\n/// @param {Colour} $colour - The colour to convert\n/// @return {Colour}\n/// @access private\n@function _as-hexadecimal($colour) {\n @if not function-exists(change-color) {\n @return $colour;\n }\n\n // `red`,`green` and `blue` functions are limited to 'legacy' colour spaces\n // ensuring we don't get floating computations on them\n $parts: (\n \"red\": red($colour),\n \"green\": green($colour),\n \"blue\": blue($colour),\n \"alpha\": alpha($colour)\n );\n\n @return change-color($colour, $parts...);\n}\n"]}
1
+ {"version":3,"sources":["../../../src/govuk/helpers/_colour.scss"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,2CAA2C;AAC3C,8BAA8B;;AAE9B,GAAG;AACH,wBAAwB;AACxB,GAAG;;AAEH,gCAAgC;AAChC,EAAE;AACF,qEAAqE;AACrE,4EAA4E;AAC5E,4CAA4C;AAC5C,EAAE;AACF,4EAA4E;AAC5E,wBAAwB;AACxB,kFAAkF;AAClF,wBAAwB;AACxB,kDAAkD;AAClD,EAAE;AACF,0DAA0D;AAC1D,oBAAoB;AACpB,mCAAmC;AACnC,MAAM;AACN,EAAE;AACF,8CAA8C;AAC9C,oBAAoB;AACpB,wDAAwD;AACxD,MAAM;AACN,EAAE;AACF,8DAA8D;AAC9D,+EAA+E;AAC/E,2FAA2F;AAC3F,iBAAiB;;AAEjB;EACE,uEAAuE;EACvE,sDAAsD;EACtD,6DAA6D;EAC7D;IACE,qBAAqB;EACvB;;EAEA,4CAA4C;;EAE5C;IACE,kFAAkF;IAClF,mFAAmF;IACnF;MACE,iEAAiE;MACjE;QACE,6BAA6B;MAC/B;IACF;;IAEA,+EAA+E;EACjF;;EAEA,gGAAgG;EAChG;IACE,wBAAwB;EAC1B;;EAEA;IACE,sGAAsG;EACxG;;EAEA,4CAA4C;;EAE5C;IACE,kHAAkH;EACpH;;EAEA,eAAe;AACjB;;AAEA;EACE,8DAA8D;;EAE9D;IACE,gDAAgD;IAChD,iDAAiD;;IAEjD,mHAAmH;;IAEnH;MACE;;;;;OAKC;IACH;;IAEA,6EAA6E;EAC/E;AACF;;AAEA,0BAA0B;AAC1B,EAAE;AACF,uEAAuE;AACvE,8EAA8E;AAC9E,0EAA0E;AAC1E,2EAA2E;AAC3E,oBAAoB;AACpB,EAAE;AACF,8CAA8C;AAC9C,uBAAuB;AACvB,+CAA+C;AAC/C,MAAM;AACN,EAAE;AACF,yDAAyD;AACzD,uBAAuB;AACvB,mDAAmD;AACnD,iDAAiD;AACjD,MAAM;AACN,EAAE;AACF,qEAAqE;AACrE,iBAAiB;AACjB,iCAAiC;AACjC;EACE,uEAAuE;EACvE,sDAAsD;EACtD,6DAA6D;EAC7D;IACE,qBAAqB;EACvB;;EAEA;IACE,0EAA0E;;IAE1E,iDAAiD;EACnD;;EAEA,gGAAgG;AAClG;;AAEA,0DAA0D;AAC1D,EAAE;AACF,0HAA0H;AAC1H,+BAA+B;AAC/B,6CAA6C;AAC7C,gDAAgD;AAChD,kBAAkB;AAClB;EACE,yDAAyD;EACzD;IACE,yBAAyB;EAC3B;;EAEA;IACE,+DAA+D;EACjE;;EAEA,yCAAyC;EACzC;IACE,oDAAoD;EACtD;;EAEA,mBAAmB;EACnB;IACE,+CAA+C;EACjD;;EAEA;IACE,uDAAuD;EACzD;;EAEA,+CAA+C;AACjD;;AAEA;EACE,sCAAsC;;EAEtC;IACE;MACE,mFAAmF;IACrF;EACF;;EAEA,sCAAsC;AACxC;;AAEA,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,8EAA8E;AAC9E,6EAA6E;AAC7E,2EAA2E;AAC3E,0EAA0E;AAC1E,0EAA0E;AAC1E,oEAAoE;AACpE,EAAE;AACF,6DAA6D;AAC7D,wDAAwD;AACxD,iBAAiB;;AAEjB;EACE,yEAAyE;EACzE,8CAA8C;EAC9C;IACE,4EAA4E;EAC9E;;EAEA,yCAAyC;EACzC;IACE,gDAAgD;EAClD;;EAEA,iEAAiE;;EAEjE,kEAAkE;EAClE,sDAAsD;EACtD;IACE;;;KAGC;EACH;;EAEA;IACE,6CAA6C;EAC/C,EAAE;IACA,sCAAsC;EACxC;AACF;;AAEA,qEAAqE;AACrE,4BAA4B;AAC5B,EAAE;AACF,8DAA8D;AAC9D,EAAE;AACF,kDAAkD;AAClD,mBAAmB;AACnB,kBAAkB;AAClB;EACE;IACE,eAAe;EACjB;;EAEA,0EAA0E;EAC1E,qDAAqD;EACrD;;;;;GAKC;;EAED,wCAAwC;AAC1C","file":"_colour.scss","sourcesContent":["@import \"../settings/colours-palette\";\n@import \"../settings/colours-organisations\";\n@import \"../settings/warnings\";\n\n////\n/// @group helpers/colour\n////\n\n/// Get a colour from the palette\n///\n/// Before using this function, check if your use case is covered by a\n/// functional colour. For example, use `govuk-functional-colour(\"link\")` for\n/// links rather than `govuk-colour(\"blue\")`.\n///\n/// @param {String | Colour} $colour - Name of colour from the colour palette\n/// (`$_govuk-palette`)\n/// @param {String | Colour} $variant - Name of the variant from the colour palette\n/// (`$_govuk-palette`)\n/// @return {Colour} Representation of named colour\n///\n/// @example scss - Getting the primary variant of a colour\n/// .my-component {\n/// color: govuk-colour(\"blue\");\n/// }\n///\n/// @example scss - Getting a 50% shade of blue\n/// .my-component {\n/// color: govuk-colour(\"blue\", $variant: \"shade-50\")\n/// }\n///\n/// @throw if `$colour` is not a colour from the colour palette\n/// @throw if `$variant` is not a variant of the `$colour` in the colour palette\n/// @throw if the palette is misformatted and doesn't associate a colour or map to `$colour`\n/// @access public\n\n@function govuk-colour($colour, $variant: primary, $colours: $_govuk-palette) {\n // Sass parses unquoted colours as colours, so we need to turn them into\n // strings before looking them up in the colour palette\n // https://sass-lang.com/documentation/values/strings#unquoted\n @if type-of($colour) != \"string\" {\n $colour: \"#{$colour}\";\n }\n\n $colour-variants: map-get($colours, $colour);\n\n @if not $colour-variants {\n // To ease the transition between the brand palette and old GOV.UK Frontend colours\n // we'll automatically convert old colour names into their equivalent in the palette\n @if $colours == $_govuk-palette {\n $corresponding-colour: _govuk-corresponding-brand-colour($colour);\n @if $corresponding-colour {\n @return $corresponding-colour;\n }\n }\n\n @error \"Unknown colour `#{$colour}` (available colours: #{map-keys($colours)})\";\n }\n\n // Some colours may not have variants, if that's the case, we can return the colour straight away\n @if type-of($colour-variants) == \"color\" {\n @return $colour-variants;\n }\n\n @if type-of($colour-variants) != \"map\" {\n @error \"Colour `#{$colour}` should either be a `map` or `color`, not a `#{type-of($colour-variants)}`\";\n }\n\n $result: map-get($colour-variants, $variant);\n\n @if not $result {\n @error \"Unknown variant `#{$variant}` for colour `#{$colour}` (available variants: #{map-keys($colour-variants)})\";\n }\n\n @return $result;\n}\n\n@function _govuk-corresponding-brand-colour($colour) {\n $pre-brand-colour: map-get($_govuk-pre-brand-colours, $colour);\n\n @if $pre-brand-colour {\n $corresponding-colour: nth($pre-brand-colour, 1);\n $corresponding-variant: nth($pre-brand-colour, 2);\n\n $corresponding-govuk-colour-call: 'govuk-colour(\"#{$corresponding-colour}\", $variant: \"#{$corresponding-variant}\")';\n\n @if _should-warn(\"pre-brand-colour\") {\n @warn _warning-text(\"pre-brand-colour\",\n \"We've updated GOV.UK Frontend's colour palette. Use \" +\n \"`#{$corresponding-govuk-colour-call}` instead of \" +\n \"`govuk-colour(\\\"#{$colour}\\\")`. The `#{$colour}` colour is \" +\n \"deprecated and we'll remove it in the next major version.\"\n );\n }\n\n @return govuk-colour($corresponding-colour, $variant: $corresponding-variant);\n }\n}\n\n/// Get a functional colour\n///\n/// @param {String|Colour} $colour - Name of the colour from the list of\n/// [functional colours](https://design-system.service.gov.uk/styles/colour/)\n/// @return {String} A reference to the functional colour's custom property\n/// wrapped in a var function, with the functional colour's hex value as a\n/// fallback value.\n///\n/// @example scss - Getting a functional colour\n/// .branded-element {\n/// color: govuk-functional-colour('brand');\n/// }\n///\n/// @example css - Output from getting a functional colour\n/// .branded-element {\n/// /* Assuming the 'brand' colour is hotpink */\n/// color: var(--govuk-brand-colour, hotpink);\n/// }\n///\n/// @throw if `$colour` is not an functional colour of GOV.UK Frontend\n/// @access public\n/// @see $govuk-functional-colours\n@function govuk-functional-colour($colour) {\n // Sass parses unquoted colours as colours, so we need to turn them into\n // strings before looking them up in the colour palette\n // https://sass-lang.com/documentation/values/strings#unquoted\n @if type-of($colour) != \"string\" {\n $colour: \"#{$colour}\";\n }\n\n @if map-has-key($govuk-functional-colours, $colour) {\n $value: _govuk-resolve-colour(map-get($govuk-functional-colours, $colour));\n\n @return var(--govuk-#{$colour}-colour, #{$value});\n }\n\n @error \"Unknown colour `#{$colour}` (available colours: #{map-keys($govuk-functional-colours)})\";\n}\n\n/// Resolves the given reference to a colour in the palette\n///\n/// @param {Map|Colour} $colour-reference - A map with the `name`, and optionally a `variant` for the colour in the palette\n/// @returns {Colour} The colour\n/// @throws if the `name` is present but falsy\n/// @throws if the `variant` is present but falsy\n/// @access private\n@function _govuk-resolve-colour($colour-reference) {\n // If the reference is already a colour, return the colour\n @if type-of($colour-reference) == \"color\" {\n @return $colour-reference;\n }\n\n @if not type-of($colour-reference) == \"map\" {\n @error 'Colour reference should be a Sass colour or a Sass map';\n }\n\n $name: map-get($colour-reference, \"name\");\n @if not $name or $name == \"\" {\n @error \"Colour reference `name` shouldn't be empty.\";\n }\n\n $variant: \"primary\";\n @if map-has-key($colour-reference, \"variant\") {\n $variant: map-get($colour-reference, \"variant\");\n }\n\n @if not $variant or $variant == \"\" {\n @error \"Colour reference `variant` shouldn't be empty.\";\n }\n\n @return govuk-colour($name, $variant: $variant);\n}\n\n@function _govuk-define-functional-colours($colours, $defaults) {\n $existing-colours: map-keys($defaults);\n\n @each $colour-name, $colour in $colours {\n @if not index($existing-colours, $colour-name) {\n @error 'Unknown colour `#{$colour-name}` (available colours: #{$existing-colours})';\n }\n }\n\n @return map-merge($defaults, $colours);\n}\n\n/// Get the colour for a government organisation\n///\n/// @param {String} $organisation - Organisation name, lowercase, hyphenated\n/// @param {Boolean} $contrast-safe [true] - By default a version of the colour\n/// will be returned which has a minimum 4.5:1 contrast ratio when used with\n/// white, as per the WCAG 2.1 Level AA guidelines. If you want to use the\n/// non-contrast safe version you can set this to `false` but your should\n/// ensure that you still meets contrast requirements for accessibility -\n/// for example, do not use the non-contrast safe version for text.\n///\n/// @return {Colour} Representation of colour for organisation\n/// @throw if `$organisation` is not a known organisation\n/// @access public\n\n@function govuk-organisation-colour($organisation, $contrast-safe: true) {\n // Check if the $organisation exists in the aliases map. If so, change the\n // value of $organisation to the aliased value.\n @if map-has-key($_govuk_colours-organisations-aliases, $organisation) {\n $organisation: map-get($_govuk_colours-organisations-aliases, $organisation);\n }\n\n // Check to see if the organisation exists\n @if not map-has-key($govuk-colours-organisations, $organisation) {\n @error \"Unknown organisation `#{$organisation}`\";\n }\n\n $org-colour: map-get($govuk-colours-organisations, $organisation);\n\n // If the organisation has a deprecation message associated with it\n // (e.g. it has ceased to exist) then output a warning.\n @if map-has-key($org-colour, \"deprecation-message\") and _should-warn(\"organisation-colours\") {\n @warn _warning-text(\n \"organisation-colours\",\n map-get($org-colour, \"deprecation-message\")\n );\n }\n\n @if $contrast-safe and map-has-key($org-colour, \"contrast-safe\") {\n @return map-get($org-colour, \"contrast-safe\");\n } @else {\n @return map-get($org-colour, \"colour\");\n }\n}\n\n/// Converts a colour with potential float values for its RGB channels\n/// into hexadecimal notation\n///\n/// This ensures the colour is rendered properly by Safari < 12\n///\n/// @param {Colour} $colour - The colour to convert\n/// @return {Colour}\n/// @access private\n@function _as-hexadecimal($colour) {\n @if not function-exists(change-color) {\n @return $colour;\n }\n\n // `red`,`green` and `blue` functions are limited to 'legacy' colour spaces\n // ensuring we don't get floating computations on them\n $parts: (\n \"red\": red($colour),\n \"green\": green($colour),\n \"blue\": blue($colour),\n \"alpha\": alpha($colour)\n );\n\n @return change-color($colour, $parts...);\n}\n"]}
@@ -20,11 +20,11 @@
20
20
  // transparent outline which will be set to a visible colour.
21
21
 
22
22
  outline: $govuk-focus-width solid transparent;
23
- color: $govuk-focus-text-colour;
24
- background-color: $govuk-focus-colour;
23
+ color: govuk-functional-colour(focus-text);
24
+ background-color: govuk-functional-colour(focus);
25
25
  box-shadow:
26
- 0 -2px $govuk-focus-colour,
27
- 0 4px $govuk-focus-text-colour;
26
+ 0 -2px govuk-functional-colour(focus),
27
+ 0 4px govuk-functional-colour(focus-text);
28
28
  // When link is focussed, hide the default underline since the
29
29
  // box shadow adds the "underline"
30
30
  text-decoration: none;
@@ -62,8 +62,8 @@
62
62
  @mixin govuk-focused-box {
63
63
  outline: $govuk-focus-width solid transparent;
64
64
  box-shadow:
65
- 0 0 0 4px $govuk-focus-colour,
66
- 0 0 0 8px $govuk-focus-text-colour;
65
+ 0 0 0 4px govuk-functional-colour(focus),
66
+ 0 0 0 8px govuk-functional-colour(focus-text);
67
67
  }
68
68
 
69
69
  /// Focused form input
@@ -79,7 +79,8 @@
79
79
  /// @access public
80
80
 
81
81
  @mixin govuk-focused-form-input {
82
- outline: $govuk-focus-width solid $govuk-focus-colour;
82
+ outline: $govuk-focus-width solid;
83
+ outline-color: govuk-functional-colour(focus);
83
84
  // Ensure outline appears outside of the element
84
85
  outline-offset: 0;
85
86
  // Double the border by adding its width again. Use `box-shadow` for this
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/govuk/helpers/_focused.scss"],"names":[],"mappings":"AAAA,GAAG;AACH,+BAA+B;AAC/B,GAAG;;AAEH,eAAe;AACf,EAAE;AACF,8EAA8E;AAC9E,4CAA4C;AAC5C,EAAE;AACF,qDAAqD;AACrD,wBAAwB;AACxB,mCAAmC;AACnC,MAAM;AACN,EAAE;AACF,iBAAiB;;AAEjB;EACE,uEAAuE;EACvE,uEAAuE;EACvE,4DAA4D;;EAE5D,6CAA6C;EAC7C,+BAA+B;EAC/B,qCAAqC;EACrC;;kCAEgC;EAChC,6DAA6D;EAC7D,iCAAiC;EACjC,qBAAqB;;EAErB,4EAA4E;EAC5E,0DAA0D;EAC1D,CAAC;EACD,4EAA4E;EAC5E,yEAAyE;EACzE,uEAAuE;EACvE,2BAA2B;EAC3B,CAAC;EACD,gCAAgC;EAChC,6DAA6D;EAC7D;IACE,mCAA2B;YAA3B,2BAA2B;EAC7B;AACF;;AAEA,cAAc;AACd,EAAE;AACF,8EAA8E;AAC9E,8EAA8E;AAC9E,sEAAsE;AACtE,yDAAyD;AACzD,EAAE;AACF,6DAA6D;AAC7D,8BAA8B;AAC9B,kCAAkC;AAClC,MAAM;AACN,EAAE;AACF,iBAAiB;;AAEjB;EACE,6CAA6C;EAC7C;;sCAEoC;AACtC;;AAEA,qBAAqB;AACrB,EAAE;AACF,8EAA8E;AAC9E,wBAAwB;AACxB,EAAE;AACF,2DAA2D;AAC3D,yBAAyB;AACzB,yCAAyC;AACzC,MAAM;AACN,EAAE;AACF,iBAAiB;;AAEjB;EACE,qDAAqD;EACrD,+CAA+C;EAC/C,iBAAiB;EACjB,wEAAwE;EACxE,mEAAmE;EACnE,uEAAuE;EACvE,qEAAqE;EACrE,wDAAwD;EACxD,wDAAwD;AAC1D","file":"_focused.scss","sourcesContent":["////\n/// @group helpers/accessibility\n////\n\n/// Focused text\n///\n/// Provides an outline to clearly indicate when the target element is focused.\n/// Used for interactive text-based elements.\n///\n/// @example scss - Styling the focus state for a link\n/// .govuk-link:focus {\n/// @include govuk-focused-text;\n/// }\n///\n/// @access public\n\n@mixin govuk-focused-text {\n // When colours are overridden, for example when users have a dark mode,\n // backgrounds and box-shadows disappear, so we need to ensure there's a\n // transparent outline which will be set to a visible colour.\n\n outline: $govuk-focus-width solid transparent;\n color: $govuk-focus-text-colour;\n background-color: $govuk-focus-colour;\n box-shadow:\n 0 -2px $govuk-focus-colour,\n 0 4px $govuk-focus-text-colour;\n // When link is focussed, hide the default underline since the\n // box shadow adds the \"underline\"\n text-decoration: none;\n\n // Fixes an issue in Chromium 108–111 where the box-shadow on the focus state\n // is missing on links that wrap across multiple lines [1].\n //\n // However, text-wrap: balance doesn't play nicely with box-decoration-break:\n // clone, causing links to re-flow when focused [2]. As text-wrap: balance\n // wasn't introduced until Chromium 114 we can use it as a way to target\n // this fix to just 108–111.\n //\n // [1]: http://crbug.com/40884971\n // [2]: https://github.com/alphagov/govuk-frontend/issues/5878\n @supports not (text-wrap: balance) {\n box-decoration-break: clone;\n }\n}\n\n/// Focused box\n///\n/// Provides an outline to clearly indicate when the target element is focused.\n/// Unlike govuk-focused-text, which only draws an underline below the element,\n/// govuk-focused-box draws an outline around all sides of the element.\n/// Best used for non-text content contained within links.\n///\n/// @example scss - Styling the focus state for a linked image\n/// .govuk-link-image:focus {\n/// @include govuk-focused-box;\n/// }\n///\n/// @access public\n\n@mixin govuk-focused-box {\n outline: $govuk-focus-width solid transparent;\n box-shadow:\n 0 0 0 4px $govuk-focus-colour,\n 0 0 0 8px $govuk-focus-text-colour;\n}\n\n/// Focused form input\n///\n/// Provides an outline to clearly indicate when the target element is focused.\n/// Used for form inputs.\n///\n/// @example scss - Styling the focus state for a form input\n/// .govuk-input:focus {\n/// @include govuk-focused-form-input;\n/// }\n///\n/// @access public\n\n@mixin govuk-focused-form-input {\n outline: $govuk-focus-width solid $govuk-focus-colour;\n // Ensure outline appears outside of the element\n outline-offset: 0;\n // Double the border by adding its width again. Use `box-shadow` for this\n // instead of changing `border-width` - this is for consistency with\n // components such as textarea where we avoid changing `border-width` as\n // it will change the element size. Also, `outline` cannot be utilised\n // here as it is already used for the yellow focus state.\n box-shadow: inset 0 0 0 $govuk-border-width-form-element;\n}\n"]}
1
+ {"version":3,"sources":["../../../src/govuk/helpers/_focused.scss"],"names":[],"mappings":"AAAA,GAAG;AACH,+BAA+B;AAC/B,GAAG;;AAEH,eAAe;AACf,EAAE;AACF,8EAA8E;AAC9E,4CAA4C;AAC5C,EAAE;AACF,qDAAqD;AACrD,wBAAwB;AACxB,mCAAmC;AACnC,MAAM;AACN,EAAE;AACF,iBAAiB;;AAEjB;EACE,uEAAuE;EACvE,uEAAuE;EACvE,4DAA4D;;EAE5D,6CAA6C;EAC7C,0CAA0C;EAC1C,gDAAgD;EAChD;;6CAE2C;EAC3C,6DAA6D;EAC7D,iCAAiC;EACjC,qBAAqB;;EAErB,4EAA4E;EAC5E,0DAA0D;EAC1D,CAAC;EACD,4EAA4E;EAC5E,yEAAyE;EACzE,uEAAuE;EACvE,2BAA2B;EAC3B,CAAC;EACD,gCAAgC;EAChC,6DAA6D;EAC7D;IACE,mCAA2B;YAA3B,2BAA2B;EAC7B;AACF;;AAEA,cAAc;AACd,EAAE;AACF,8EAA8E;AAC9E,8EAA8E;AAC9E,sEAAsE;AACtE,yDAAyD;AACzD,EAAE;AACF,6DAA6D;AAC7D,8BAA8B;AAC9B,kCAAkC;AAClC,MAAM;AACN,EAAE;AACF,iBAAiB;;AAEjB;EACE,6CAA6C;EAC7C;;iDAE+C;AACjD;;AAEA,qBAAqB;AACrB,EAAE;AACF,8EAA8E;AAC9E,wBAAwB;AACxB,EAAE;AACF,2DAA2D;AAC3D,yBAAyB;AACzB,yCAAyC;AACzC,MAAM;AACN,EAAE;AACF,iBAAiB;;AAEjB;EACE,iCAAiC;EACjC,6CAA6C;EAC7C,+CAA+C;EAC/C,iBAAiB;EACjB,wEAAwE;EACxE,mEAAmE;EACnE,uEAAuE;EACvE,qEAAqE;EACrE,wDAAwD;EACxD,wDAAwD;AAC1D","file":"_focused.scss","sourcesContent":["////\n/// @group helpers/accessibility\n////\n\n/// Focused text\n///\n/// Provides an outline to clearly indicate when the target element is focused.\n/// Used for interactive text-based elements.\n///\n/// @example scss - Styling the focus state for a link\n/// .govuk-link:focus {\n/// @include govuk-focused-text;\n/// }\n///\n/// @access public\n\n@mixin govuk-focused-text {\n // When colours are overridden, for example when users have a dark mode,\n // backgrounds and box-shadows disappear, so we need to ensure there's a\n // transparent outline which will be set to a visible colour.\n\n outline: $govuk-focus-width solid transparent;\n color: govuk-functional-colour(focus-text);\n background-color: govuk-functional-colour(focus);\n box-shadow:\n 0 -2px govuk-functional-colour(focus),\n 0 4px govuk-functional-colour(focus-text);\n // When link is focussed, hide the default underline since the\n // box shadow adds the \"underline\"\n text-decoration: none;\n\n // Fixes an issue in Chromium 108–111 where the box-shadow on the focus state\n // is missing on links that wrap across multiple lines [1].\n //\n // However, text-wrap: balance doesn't play nicely with box-decoration-break:\n // clone, causing links to re-flow when focused [2]. As text-wrap: balance\n // wasn't introduced until Chromium 114 we can use it as a way to target\n // this fix to just 108–111.\n //\n // [1]: http://crbug.com/40884971\n // [2]: https://github.com/alphagov/govuk-frontend/issues/5878\n @supports not (text-wrap: balance) {\n box-decoration-break: clone;\n }\n}\n\n/// Focused box\n///\n/// Provides an outline to clearly indicate when the target element is focused.\n/// Unlike govuk-focused-text, which only draws an underline below the element,\n/// govuk-focused-box draws an outline around all sides of the element.\n/// Best used for non-text content contained within links.\n///\n/// @example scss - Styling the focus state for a linked image\n/// .govuk-link-image:focus {\n/// @include govuk-focused-box;\n/// }\n///\n/// @access public\n\n@mixin govuk-focused-box {\n outline: $govuk-focus-width solid transparent;\n box-shadow:\n 0 0 0 4px govuk-functional-colour(focus),\n 0 0 0 8px govuk-functional-colour(focus-text);\n}\n\n/// Focused form input\n///\n/// Provides an outline to clearly indicate when the target element is focused.\n/// Used for form inputs.\n///\n/// @example scss - Styling the focus state for a form input\n/// .govuk-input:focus {\n/// @include govuk-focused-form-input;\n/// }\n///\n/// @access public\n\n@mixin govuk-focused-form-input {\n outline: $govuk-focus-width solid;\n outline-color: govuk-functional-colour(focus);\n // Ensure outline appears outside of the element\n outline-offset: 0;\n // Double the border by adding its width again. Use `box-shadow` for this\n // instead of changing `border-width` - this is for consistency with\n // components such as textarea where we avoid changing `border-width` as\n // it will change the element size. Also, `outline` cannot be utilised\n // here as it is already used for the yellow focus state.\n box-shadow: inset 0 0 0 $govuk-border-width-form-element;\n}\n"]}
@@ -76,25 +76,25 @@
76
76
 
77
77
  @mixin govuk-link-style-default {
78
78
  &:link {
79
- color: $govuk-link-colour;
79
+ color: govuk-functional-colour(link);
80
80
  }
81
81
 
82
82
  &:visited {
83
- color: $govuk-link-visited-colour;
83
+ color: govuk-functional-colour(link-visited);
84
84
  }
85
85
 
86
86
  &:hover {
87
- color: $govuk-link-hover-colour;
87
+ color: govuk-functional-colour(link-hover);
88
88
  }
89
89
 
90
90
  &:active {
91
- color: $govuk-link-active-colour;
91
+ color: govuk-functional-colour(link-active);
92
92
  }
93
93
 
94
94
  // When focussed, the text colour needs to be darker to ensure that colour
95
95
  // contrast is still acceptable
96
96
  &:focus {
97
- color: $govuk-focus-text-colour;
97
+ color: govuk-functional-colour(focus-text);
98
98
  }
99
99
  }
100
100
 
@@ -117,21 +117,21 @@
117
117
  @mixin govuk-link-style-error {
118
118
  &:link,
119
119
  &:visited {
120
- color: $govuk-error-colour;
120
+ color: govuk-functional-colour(error);
121
121
  }
122
122
 
123
123
  &:hover {
124
- color: scale-color($govuk-error-colour, $lightness: -30%);
124
+ color: govuk-colour("red", $variant: "shade-50");
125
125
  }
126
126
 
127
127
  &:active {
128
- color: $govuk-error-colour;
128
+ color: govuk-functional-colour(error);
129
129
  }
130
130
 
131
131
  // When focussed, the text colour needs to be darker to ensure that colour
132
132
  // contrast is still acceptable
133
133
  &:focus {
134
- color: $govuk-focus-text-colour;
134
+ color: govuk-functional-colour(focus-text);
135
135
  }
136
136
  }
137
137
 
@@ -154,21 +154,21 @@
154
154
  @mixin govuk-link-style-success {
155
155
  &:link,
156
156
  &:visited {
157
- color: $govuk-success-colour;
157
+ color: govuk-functional-colour(success);
158
158
  }
159
159
 
160
160
  &:hover {
161
- color: scale-color($govuk-success-colour, $lightness: -30%);
161
+ color: govuk-colour("green", $variant: "shade-50");
162
162
  }
163
163
 
164
164
  &:active {
165
- color: $govuk-success-colour;
165
+ color: govuk-functional-colour(success);
166
166
  }
167
167
 
168
168
  // When focussed, the text colour needs to be darker to ensure that colour
169
169
  // contrast is still acceptable
170
170
  &:focus {
171
- color: $govuk-focus-text-colour;
171
+ color: govuk-functional-colour(focus-text);
172
172
  }
173
173
  }
174
174
 
@@ -191,18 +191,18 @@
191
191
  @mixin govuk-link-style-muted {
192
192
  &:link,
193
193
  &:visited {
194
- color: $govuk-secondary-text-colour;
194
+ color: govuk-functional-colour(secondary-text);
195
195
  }
196
196
 
197
197
  &:hover,
198
198
  &:active {
199
- color: $govuk-text-colour;
199
+ color: govuk-functional-colour(text);
200
200
  }
201
201
 
202
202
  // When focussed, the text colour needs to be darker to ensure that colour
203
203
  // contrast is still acceptable
204
204
  &:focus {
205
- color: $govuk-focus-text-colour;
205
+ color: govuk-functional-colour(focus-text);
206
206
  }
207
207
  }
208
208
 
@@ -228,14 +228,6 @@
228
228
  @include govuk-text-colour;
229
229
  }
230
230
 
231
- // Force a colour change on hover to work around a bug in Safari
232
- // https://webkit.org/b/224483
233
- &:hover {
234
- @if type-of($govuk-text-colour) == color {
235
- color: rgba($govuk-text-colour, 0.99);
236
- }
237
- }
238
-
239
231
  &:active,
240
232
  &:focus {
241
233
  @include govuk-text-colour;
@@ -264,15 +256,8 @@
264
256
  color: govuk-colour("white");
265
257
  }
266
258
 
267
- // Force a colour change on hover to work around a bug in Safari
268
- // https://webkit.org/b/224483
269
- &:hover,
270
- &:active {
271
- color: rgba(govuk-colour("white"), 0.99);
272
- }
273
-
274
259
  &:focus {
275
- color: $govuk-focus-text-colour;
260
+ color: govuk-functional-colour(focus-text);
276
261
  }
277
262
  }
278
263
 
@@ -298,25 +283,25 @@
298
283
 
299
284
  @mixin govuk-link-style-no-visited-state {
300
285
  &:link {
301
- color: $govuk-link-colour;
286
+ color: govuk-functional-colour(link);
302
287
  }
303
288
 
304
289
  &:visited {
305
- color: $govuk-link-colour;
290
+ color: govuk-functional-colour(link);
306
291
  }
307
292
 
308
293
  &:hover {
309
- color: $govuk-link-hover-colour;
294
+ color: govuk-functional-colour(link-hover);
310
295
  }
311
296
 
312
297
  &:active {
313
- color: $govuk-link-active-colour;
298
+ color: govuk-functional-colour(link-active);
314
299
  }
315
300
 
316
301
  // When focussed, the text colour needs to be darker to ensure that colour
317
302
  // contrast is still acceptable
318
303
  &:focus {
319
- color: $govuk-focus-text-colour;
304
+ color: govuk-functional-colour(focus-text);
320
305
  }
321
306
  }
322
307
 
@@ -351,8 +336,7 @@
351
336
  @media print {
352
337
  &[href^="/"],
353
338
  &[href^="http://"],
354
- &[href^="https://"]
355
- {
339
+ &[href^="https://"] {
356
340
  &::after {
357
341
  content: " (" attr(href) ")";
358
342
  font-size: 90%;