From 71c3b3befeab5f3e58caa5cbbc5198527f110521 Mon Sep 17 00:00:00 2001 From: Paul Robert Lloyd Date: Wed, 20 Nov 2024 12:11:15 +0000 Subject: [PATCH 1/3] Remove support for disabled link buttons --- packages/components/button/template.njk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/components/button/template.njk b/packages/components/button/template.njk index d893f02cc..b1ace4ed9 100644 --- a/packages/components/button/template.njk +++ b/packages/components/button/template.njk @@ -27,7 +27,7 @@ {%- endset -%} {% if element == 'a' %} - + {{ params.html | safe if params.html else params.text }} From e7b5a1cf7fda35d591ce7f98c8b5aad6162c1382 Mon Sep 17 00:00:00 2001 From: Paul Robert Lloyd Date: Wed, 20 Nov 2024 12:14:39 +0000 Subject: [PATCH 2/3] Remove nhsuk-button--disabled modifier Disabled style is applied to any nhs-button with the disabled attribute --- packages/components/button/README.md | 2 +- packages/components/button/_button.scss | 1 - packages/components/button/template.njk | 3 +-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/components/button/README.md b/packages/components/button/README.md index 13d0af4db..ee8826ce5 100644 --- a/packages/components/button/README.md +++ b/packages/components/button/README.md @@ -62,7 +62,7 @@ Find out more about the button component and when to use it in the [NHS digital #### HTML markup ```html - ``` diff --git a/packages/components/button/_button.scss b/packages/components/button/_button.scss index 5bc8990ce..fac373d6a 100644 --- a/packages/components/button/_button.scss +++ b/packages/components/button/_button.scss @@ -194,7 +194,6 @@ $button-shadow-size: 4px; /** * Button disabled states */ -.nhsuk-button--disabled, .nhsuk-button:disabled { opacity: (0.5); pointer-events: none; diff --git a/packages/components/button/template.njk b/packages/components/button/template.njk index b1ace4ed9..cb321c7e8 100644 --- a/packages/components/button/template.njk +++ b/packages/components/button/template.njk @@ -14,8 +14,7 @@ {# Define common attributes that we can use across all element types #} {% set commonAttributes %} class="nhsuk-button - {%- if params.classes %} {{ params.classes }}{% endif %} - {%- if params.disabled %} nhsuk-button--disabled{% endif %}" + {%- if params.classes %} {{ params.classes }}{% endif %}" data-module="nhsuk-button" {% if params.preventDoubleClick %} data-prevent-double-click="true"{% endif %} {{- nhsukAttributes(params.attributes) }} From e6656d608f1fc6f99df386d91d2da75ea946ab44 Mon Sep 17 00:00:00 2001 From: Paul Robert Lloyd Date: Wed, 20 Nov 2024 12:15:29 +0000 Subject: [PATCH 3/3] Use boolean for disabled attribute --- packages/components/button/README.md | 2 +- packages/components/button/template.njk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/components/button/README.md b/packages/components/button/README.md index ee8826ce5..cade89045 100644 --- a/packages/components/button/README.md +++ b/packages/components/button/README.md @@ -62,7 +62,7 @@ Find out more about the button component and when to use it in the [NHS digital #### HTML markup ```html - ``` diff --git a/packages/components/button/template.njk b/packages/components/button/template.njk index cb321c7e8..ef949d08b 100644 --- a/packages/components/button/template.njk +++ b/packages/components/button/template.njk @@ -22,7 +22,7 @@ {# Define common attributes we can use for both button and input types #} {%- set buttonAttributes %}{% if params.name %} name="{{ params.name }}"{% endif %} type="{{ params.type if params.type else 'submit' }}" - {%- if params.disabled %} disabled="disabled" aria-disabled="true"{% endif %} + {%- if params.disabled %} disabled aria-disabled="true"{% endif %} {%- endset -%} {% if element == 'a' %}