From 2e93f628c8d223a633ed6eaa7845576740b1b529 Mon Sep 17 00:00:00 2001 From: Ed Horsford Date: Thu, 22 Aug 2024 11:08:07 +0100 Subject: [PATCH] Add attributes macro (#998) * Add attributes macro copied from GOV.UK --- CHANGELOG.md | 1 + packages/components/action-link/template.njk | 4 +- packages/components/back-link/template.njk | 4 +- packages/components/breadcrumb/template.njk | 8 +- packages/components/button/template.njk | 4 +- packages/components/card/template.njk | 4 +- packages/components/checkboxes/template.njk | 5 +- .../components/contents-list/template.njk | 4 +- packages/components/date-input/template.njk | 3 +- packages/components/details/template.njk | 4 +- packages/components/do-dont-list/template.njk | 4 +- .../components/error-message/template.njk | 4 +- .../components/error-summary/template.njk | 6 +- packages/components/fieldset/template.njk | 4 +- packages/components/footer/template.njk | 4 +- packages/components/header/template.njk | 10 +- packages/components/hero/template.njk | 4 +- packages/components/hint/template.njk | 4 +- packages/components/images/template.njk | 4 +- packages/components/input/template.njk | 3 +- packages/components/inset-text/template.njk | 4 +- packages/components/label/template.njk | 4 +- packages/components/pagination/template.njk | 4 +- packages/components/radios/template.njk | 5 +- packages/components/select/template.njk | 5 +- packages/components/skip-link/template.njk | 4 +- packages/components/summary-list/template.njk | 4 +- packages/components/tables/template.njk | 4 +- packages/components/tabs/template.njk | 10 +- packages/components/tag/template.njk | 4 +- packages/components/textarea/template.njk | 3 +- .../components/warning-callout/template.njk | 4 +- packages/macros/attributes.njk | 96 +++++++++++++++++++ 33 files changed, 196 insertions(+), 43 deletions(-) create mode 100644 packages/macros/attributes.njk diff --git a/CHANGELOG.md b/CHANGELOG.md index 21bcac47b..51342ffba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased - Fix Sass deprecation on `mix` function (passing a number without unit) ([PR 995](https://github.com/nhsuk/nhsuk-frontend/pull/995)) +- Add nhsukAttributes macro, copied from GOV.UK ([PR 998](https://github.com/nhsuk/nhsuk-frontend/pull/998)) ## 8.3.0 - 24 July 2024 diff --git a/packages/components/action-link/template.njk b/packages/components/action-link/template.njk index fc6d9cddd..49cef6edb 100644 --- a/packages/components/action-link/template.njk +++ b/packages/components/action-link/template.njk @@ -1,9 +1,11 @@ +{% from "../../macros/attributes.njk" import nhsukAttributes %} +