Skip to content

Commit

Permalink
Merge branch 'main' into secondary-button
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhunter08 authored Nov 20, 2024
2 parents 477c3b2 + 4b7c7fc commit f57f93c
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 77 deletions.
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 @@ -160,10 +160,6 @@ $button-padding-left-right: nhsuk-spacing(3);
padding-top: $button-padding-top-bottom-mobile; /* 4 */
}
}

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

.nhsuk-button--reverse {
Expand Down Expand Up @@ -197,14 +193,6 @@ $button-padding-left-right: nhsuk-spacing(3);
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 @@ -228,75 +216,13 @@ $button-padding-left-right: nhsuk-spacing(3);
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.

0 comments on commit f57f93c

Please sign in to comment.