From 27eedc9c52e4e724058430344e9ed8b3813bc88c Mon Sep 17 00:00:00 2001 From: Will Pearson Date: Mon, 5 Feb 2024 20:33:58 +0000 Subject: [PATCH 01/11] Updating for govuk-frontend 4.80 Notes: - Updated govuk_frontend_jinja/templates/components/header/macro.html to work like version 4.8.0 of govuk-frontend - tested with ./govuk-frontend-diff-macos http://localhost:3000 --govuk-frontend-version=v4.8.0 --include header as without the header the test suite fails with ECONNRESET on my machine --- README.md | 1 + .../templates/components/header/macro.html | 85 ++++++++++++------- 2 files changed, 55 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index cdb5538c..0f93383b 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ The following table shows the version of GOV.UK Frontend Jinja that you should u | GOV.UK Frontend Jinja Version | Target GOV.UK Frontend Version | | ----------------------------- | ------------------------------ | +| [2.8.0](https://github.com/LandRegistry/govuk-frontend-jinja/releases/tag/2.8.0) | [4.7.0](https://github.com/alphagov/govuk-frontend/releases/tag/v4.8.0) | | [2.7.0](https://github.com/LandRegistry/govuk-frontend-jinja/releases/tag/2.7.0) | [4.7.0](https://github.com/alphagov/govuk-frontend/releases/tag/v4.7.0) | | [2.6.0](https://github.com/LandRegistry/govuk-frontend-jinja/releases/tag/2.6.0) | [4.6.0](https://github.com/alphagov/govuk-frontend/releases/tag/v4.6.0) | | [2.5.0](https://github.com/LandRegistry/govuk-frontend-jinja/releases/tag/2.5.0) | [4.5.0](https://github.com/alphagov/govuk-frontend/releases/tag/v4.5.0) | diff --git a/govuk_frontend_jinja/templates/components/header/macro.html b/govuk_frontend_jinja/templates/components/header/macro.html index 6de10ad3..a8596121 100644 --- a/govuk_frontend_jinja/templates/components/header/macro.html +++ b/govuk_frontend_jinja/templates/components/header/macro.html @@ -1,43 +1,66 @@ {% macro govukHeader(params) %} {% set menuButtonText = params.menuButtonText if params.menuButtonText else 'Menu' %} +{#- We use an inline SVG for the crown so that we can cascade the +currentColor into the crown whilst continuing to support older browsers +which do not support external SVGs without a Javascript polyfill. This +adds approximately 1kb to every page load. +We use currentColour so that we can easily invert it when printing and +when the focus state is applied. This also benefits users who override +colours in their browser as they will still see the crown. +The SVG needs `focusable="false"` so that Internet Explorer does not +treat it as an interactive element - without this it will be +'focusable' when using the keyboard to navigate. #} + +{% set _stEdwardsCrown %} + + + + +{% endset %} + +{% set _tudorCrown %} + + + + +{% endset %} +