Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove support for disabled links #1075

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/components/button/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Find out more about the button component and when to use it in the [NHS digital
#### HTML markup

```html
<button class="nhsuk-button nhsuk-button--disabled" type="submit" disabled="disabled" aria-disabled="true" data-module="nhsuk-button">
<button class="nhsuk-button" type="submit" disabled aria-disabled="true" data-module="nhsuk-button">
Disabled button
</button>
```
Expand Down
1 change: 0 additions & 1 deletion packages/components/button/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ $button-shadow-size: 4px;
/**
* Button disabled states
*/
.nhsuk-button--disabled,
.nhsuk-button:disabled {
opacity: (0.5);
pointer-events: none;
Expand Down
7 changes: 3 additions & 4 deletions packages/components/button/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,19 @@

{# 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) }}
{%- endset -%}

{# 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' %}
<a{{ commonAttributes | safe }} href="{{ params.href if params.href else '#' }}" draggable="false"{%- if params.disabled %} aria-disabled="true"{% endif %} role="button">
<a{{ commonAttributes | safe }} href="{{ params.href if params.href else '#' }}" draggable="false" role="button">
{{ params.html | safe if params.html else params.text }}
</a>

Expand Down
Loading