Skip to content
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Unreleased

### Improvements

- Update styling for Alert component for increased contrast and consistency with U.S. Web Design System. ([#439](https://github.com/18F/identity-design-system/pull/439))

## 9.1.0

### New Features
Expand Down
1 change: 0 additions & 1 deletion src/img/alerts/info.svg
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to remove all of the files in this folder, but there's a few that are still currently in use:

  • alerts/success.svg (used by "Success Message" and "Badge" components)
  • alerts/error.svg (used by "Error Message" component)
  • alerts/unphishable.svg (used by "Badge" component)

I'll plan to make these changes separately.

For all except the unphishable icon, I think it's a pretty straight-forward swap to use an equivalent Icon instead.

Two caveats:

  • There's not a great equivalent design for unphishable icon. lock and lock_outline are pretty close, but they don't have the inverted circle effect that the current icon has.
  • While Success and Error Message icons are applied in styles and can be done in a backwards-compatible manner, the badge icons are embedded in the actual markup, so this could be a breaking change if downstream projects are referencing the icon assets directly.
    • For this reason, it might make sense to keep at least success.svg and unphishable.svg assets present until the next major version release

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense to keep the success.svg and unphishable.svg until we consider the badges more thoroughly.

This file was deleted.

1 change: 0 additions & 1 deletion src/img/alerts/warning.svg

This file was deleted.

1 change: 0 additions & 1 deletion src/scss/packages/_uswds-core.scss
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ $site-palette: (
$theme-accordion-border-width: '1px' !default,
$theme-accordion-border-color: 'primary-light' !default,
// Alert
$theme-alert-bar-width: 0 !default,
$theme-alert-icon-size: 2 !default,
$theme-alert-padding-x: 2 !default,
$theme-alert-padding-y: 1.5 !default,
Expand Down
23 changes: 9 additions & 14 deletions src/scss/packages/usa-alert/src/_overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,22 @@ $alerts: 'success', 'warning', 'error', 'info', 'emergency';

.usa-alert__body {
@include u-padding-x($theme-alert-padding-x); // See: https://github.com/uswds/uswds/issues/5252

&::before {
background-color: transparent;
background-position: center;
mask: none;
}
padding-left: units($theme-alert-icon-size) + (1.5 * $alert-icon-optical-padding);
}
}

@each $name in $alerts {
.usa-alert--#{$name} .usa-alert__body {
&::before {
@include add-background-svg('alerts/#{$name}');
left: $alert-icon-optical-padding;
top: units($theme-alert-padding-y) + units(0.5);
}

padding-left: units($theme-alert-icon-size) + (1.5 * $alert-icon-optical-padding);
.usa-alert--#{$name} .usa-alert__body::before {
left: $alert-icon-optical-padding;
top: units($theme-alert-padding-y) + units(0.5);
}
}

.usa-alert--other {
background-color: color('primary-lighter');
border-left-color: color('primary-light');

.usa-alert__body {
padding-left: units($theme-alert-padding-x);
}
}