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

Correctly style disabled warning button #1051

Merged
merged 4 commits into from
Nov 20, 2024
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

:wrench: **Fixes**

- Fix appearance of disabled warning buttons ([Issue 1034]([https://github.com/nhsuk/nhsuk-service-manual-community-backlog/issues/1034]))
- Fix layout bug where breadcrumb component was changing height when more than one link shown
- Fix print styling bug with emergency care card ([Issue 533]([https://github.com/nhsuk/nhsuk-service-manual-community-backlog/issues/533]))

Expand Down
24 changes: 22 additions & 2 deletions app/components/button/disabled.njk
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,34 @@

<div class="nhsuk-width-container">
<main class="nhsuk-main-wrapper" id="maincontent">

<div class="nhsuk-grid-row">
<div class="nhsuk-grid-column-two-thirds">
<div class="nhsuk-grid-column-full">
{{ button({
"text": "Disabled button",
"disabled": true
}) }}
</div>
<div class="nhsuk-grid-column-full">
{{ button({
"text": "Disabled secondary button",
"classes": "nhsuk-button--secondary",
"disabled": true
}) }}
</div>
<div class="nhsuk-grid-column-full">
{{ button({
"text": "Disabled reversed button",
"classes": "nhsuk-button--reverse",
"disabled": true
}) }}
</div>
<div class="nhsuk-grid-column-full">
{{ button({
"text": "Disabled warning button",
"classes": "nhsuk-button--warning",
"disabled": true
}) }}
</div>
</div>
</main>
</div>
Expand Down
76 changes: 1 addition & 75 deletions packages/components/button/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,6 @@ $button-shadow-size: 4px;
color: $nhsuk-button-text-color;
top: $button-shadow-size;
}

&.nhsuk-button--disabled {
background-color: $nhsuk-secondary-button-color;
}
}

.nhsuk-button--reverse {
Expand Down Expand Up @@ -170,14 +166,6 @@ $button-shadow-size: 4px;
color: $color_nhsuk-white;
}
}

&.nhsuk-button--disabled {
background-color: $nhsuk-reverse-button-color;

&:focus {
background-color: $nhsuk-reverse-button-color;
}
}
}

.nhsuk-button--warning {
Expand All @@ -201,75 +189,13 @@ $button-shadow-size: 4px;
color: $nhsuk-button-text-color;
top: $button-shadow-size;
}

&.nhsuk-button--disabled {
background-color: $nhsuk-warning-button-color;
}
}

/**
* Button disabled states
*/
/* stylelint-disable string-quotes */
.nhsuk-button--disabled,
.nhsuk-button[disabled="disabled"],
.nhsuk-button[disabled] {
background-color: $nhsuk-button-color;
.nhsuk-button:disabled {
opacity: (0.5);
pointer-events: none;

&:hover {
background-color: $nhsuk-button-color;
cursor: default;
}

&:focus {
background-color: $nhsuk-button-color;
outline: none;
}

&:active {
box-shadow: 0 $button-shadow-size 0 $nhsuk-button-shadow-color; // s0
top: 0;
}
}

.nhsuk-button--secondary[disabled="disabled"],
.nhsuk-button--secondary[disabled] {
background-color: $nhsuk-secondary-button-color;
opacity: (0.5);

&:hover {
background-color: $nhsuk-secondary-button-color;
cursor: default;
}

&:focus {
outline: none;
}

&:active {
box-shadow: 0 $button-shadow-size 0 $nhsuk-secondary-button-shadow-color; // s0
top: 0;
}
}

.nhsuk-button--reverse[disabled="disabled"],
.nhsuk-button--reverse[disabled] {
background-color: $nhsuk-reverse-button-color;
opacity: (0.5);

&:hover {
background-color: $nhsuk-reverse-button-color;
cursor: default;
}

&:focus {
outline: none;
}

&:active {
box-shadow: 0 $button-shadow-size 0 $nhsuk-reverse-button-shadow-color; // s0
top: 0;
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading