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

Add variant support for danger outline buttons #383

Merged
merged 4 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Unreleased

### New Features

- Add variant support for danger outline buttons.

### Dependencies

- Update USWDS from v3.6.1 to v3.7.0. ([#381](https://github.com/18F/identity-style-guide/pull/381))
Expand Down
28 changes: 28 additions & 0 deletions docs/_components/buttons.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,20 @@ subnav:
<button class="usa-button usa-button--danger" disabled>Disabled</button>
</div>

### Danger Outline

```html
<button class="usa-button usa-button--danger usa-button--outline">
```

<div>
<button class="usa-button usa-button--danger usa-button--outline">Default</button>
<button class="usa-button usa-button--danger usa-button--outline usa-button--hover">Hover</button>
<button class="usa-button usa-button--danger usa-button--outline usa-button--active">Active</button>
<button class="usa-button usa-button--danger usa-button--outline usa-focus">Focus</button>
<button class="usa-button usa-button--danger usa-button--outline" disabled>Disabled</button>
</div>

### Unstyled

```html
Expand Down Expand Up @@ -115,6 +129,20 @@ subnav:
<button class="usa-button usa-button--big usa-button--danger" disabled>Disabled</button>
</div>

### Danger Outline

```html
<button class="usa-button usa-button--big usa-button--danger usa-button--outline">
```

<div>
<button class="usa-button usa-button--big usa-button--danger usa-button--outline">Default</button>
<button class="usa-button usa-button--big usa-button--danger usa-button--outline usa-button--hover">Hover</button>
<button class="usa-button usa-button--big usa-button--danger usa-button--outline usa-button--active">Active</button>
<button class="usa-button usa-button--big usa-button--danger usa-button--outline usa-focus">Focus</button>
<button class="usa-button usa-button--big usa-button--danger usa-button--outline" disabled>Disabled</button>
</div>

### Unstyled

```html
Expand Down
22 changes: 22 additions & 0 deletions src/scss/packages/usa-button/src/_overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,28 @@ $button-stroke-big: inset 0 0 0 units($theme-button-stroke-width * 2);
&.usa-button--active {
background-color: color('secondary-darkest');
}

&.usa-button--outline:not(:disabled, .usa-button--disabled) {
background-color: color('white');
box-shadow: inset 0 0 0 $theme-button-stroke-width color('secondary');
color: color('secondary');

&.usa-button--big {
box-shadow: $button-stroke-big color('secondary');
}

&:hover,
&.usa-button--hover {
background-color: color('secondary-lightest');
}

&:active,
&.usa-button--active {
background-color: color('secondary-lighter');
box-shadow: inset 0 0 0 $theme-button-stroke-width color('secondary-dark');
color: color('secondary-dark');
}
}
}

.usa-button--inverse {
Expand Down