Skip to content

Commit 92c7be5

Browse files
committed
Use new icon set in alerts
1 parent 8517dd4 commit 92c7be5

File tree

2 files changed

+11
-24
lines changed

2 files changed

+11
-24
lines changed

src/stylesheets/components/_alerts.scss

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,13 @@
11
// Alert variables ---------- //
2-
// TODO: Custom alerts are effectively hidden and not well supported
3-
// Consider removing or rebuilding
4-
$usa-custom-alerts: () !default;
5-
$usa-custom-alerts-bar: () !default;
6-
7-
$usa-alerts: (
8-
success: "success-lighter",
9-
warning: "warning-lighter",
10-
error: "error-lighter",
11-
info: "info-lighter",
12-
emergency: "emergency",
13-
);
142

15-
$usa-alerts-bar: (
16-
success: "success",
3+
$usa-alert-icons: (
4+
success: "check_circle",
175
warning: "warning",
186
error: "error",
197
info: "info",
20-
emergency: "emergency-dark",
8+
emergency: "warning",
219
);
2210

23-
$alerts: map-merge($usa-alerts, $usa-custom-alerts);
24-
$alerts-bar: map-merge($usa-alerts-bar, $usa-custom-alerts-bar);
2511
$alert-padding-left: units($theme-alert-padding-x) +
2612
units($theme-alert-bar-width);
2713

@@ -31,7 +17,7 @@ $alert-padding-left: units($theme-alert-padding-x) +
3117
background-color: color("base-lightest");
3218
background-position: $alert-padding-left units($theme-alert-padding-x);
3319
background-repeat: no-repeat;
34-
background-size: units(4);
20+
background-size: units(5);
3521
padding-bottom: units(2);
3622
padding-left: $alert-padding-left;
3723
padding-right: units($theme-alert-padding-x);
@@ -92,9 +78,9 @@ $alert-padding-left: units($theme-alert-padding-x) +
9278
padding-top: units(0.5);
9379
}
9480

95-
@each $name, $bgcolor in $alerts {
81+
@each $name, $icon in $usa-alert-icons {
9682
.usa-alert--#{$name} {
97-
@include alert-status-styles($name, $bgcolor);
83+
@include alert-status-styles($name, $icon);
9884
}
9985
}
10086

src/stylesheets/core/mixins/_alert-status-styles.scss

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
@mixin alert-status-styles($name, $bgcolor) {
2-
@include add-background-svg("alerts/#{$name}");
3-
background-color: color($bgcolor);
1+
@mixin alert-status-styles($name, $icon) {
2+
@include add-background-svg("usa-icons/#{$icon}");
3+
$bgcolor: if($name != "emergency", "#{$name}-lighter", $name);
44
$banner-text-color-token: get-token-from-bg($bgcolor);
5+
background-color: color($bgcolor);
56
color: color($banner-text-color-token);
67

78
&::before {
8-
background-color: color(map-get($alerts-bar, $name));
9+
background-color: color($name);
910
}
1011

1112
.usa-alert__body {

0 commit comments

Comments
 (0)