-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
On our staff facing service, we use interruption screens that warn a user before they proceed to undertake an action that is destructive and/or cannot be undone. On these pages, we use also a red warning button to further indicate that a destructive action will take place: <img width="740" alt="Screenshot of a screen asking if a user wants to delete a vaccine." src="https://github.com/nhsuk/nhsuk-frontend/assets/813383/be9fe626-8851-4053-8a7d-925031c8bee2"> This follows [a similar pattern from the GOV.UK Design System](https://design-system.service.gov.uk/components/button/#warning-buttons): > ### Warning buttons > > Warning buttons are designed to make users think carefully before they use them. They only work if used very sparingly. Most services should not need one. This PR adds an equivalent `--warning` variant to `nhsuk-button`. In the corresponding Service Manual guidance for this component, we can start by using the same guidance as that used in the GOV.UK Design System.
- Loading branch information
1 parent
ab64725
commit 65cacf0
Showing
6 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{% set html_style = 'background-color: #f0f4f5;' %} | ||
{% set title = 'Button warning' %} | ||
{% from 'components/button/macro.njk' import button %} | ||
{% extends 'layout.njk' %} | ||
|
||
{% block body %} | ||
|
||
<div class="nhsuk-width-container"> | ||
<main class="nhsuk-main-wrapper" id="maincontent"> | ||
|
||
<div class="nhsuk-grid-row"> | ||
<div class="nhsuk-grid-column-two-thirds"> | ||
{{ button({ | ||
"text": "Yes, delete this vaccine", | ||
"classes": "nhsuk-button--warning" | ||
}) }} | ||
</div> | ||
</div> | ||
</main> | ||
</div> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters