Skip to content

Commit a032030

Browse files
author
Colleen Palmer
committed
Alerts do not meet color contrast requirements
closes CNVS-23377 This changes the global alert notifications in the styleguide to meet our webaim contrast ratios. Test Plan: - Go to /styleguide - Go to Hightlights & Alerts section - All colors meet our 3:1 contrast ratio - Turn on High-contrast mode - Go back to Alert section in styleguide - All colors meet our 4.5:1 contrast ratio UI dev notes: - I moved bootstrap/_alerts css into our component/_alerts file - Took out _alerts from the custom_bootstrap file - Took out some commenting cruft in custom_bootstrap - Took out .alert-block css since on searching it didn't appear to be used anywhere - Took out some of the bootstrap styles on the notifications (border, text-shadow, and margin); then switched out the colors for our variables - The "info" alert pulls in the primary color variables, so if customized, that will pull in custom colors Change-Id: I95b0ebb3cc833fd252160245e176c5dfeeb001b2 Reviewed-on: https://gerrit.instructure.com/64321 Tested-by: Jenkins Reviewed-by: Chris Hart <chart@instructure.com> Product-Review: Chris Hart <chart@instructure.com> QA-Review: Myller de Araujo <myller@instructure.com>
1 parent 05a9d01 commit a032030

4 files changed

Lines changed: 47 additions & 71 deletions

File tree

app/stylesheets/base/_custom_bootstrap.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,16 @@
1616
@import "vendor/bootstrap/tables";
1717

1818
// Components: common
19-
//@import "vendor/bootstrap/sprites"; //we do our own icons
2019
@import "vendor/bootstrap/dropdowns";
2120
@import "vendor/bootstrap/wells";
2221
@import "vendor/bootstrap/component-animations";
2322
@import "vendor/bootstrap/close";
2423

25-
// Components: Alerts
26-
@import "vendor/bootstrap/alerts";
27-
2824
// Components: Nav
2925
@import "vendor/bootstrap/navs";
3026
@import "vendor/bootstrap/pagination";
3127

3228
// Components: Popovers
33-
//@import "vendor/bootstrap/modals"; // use jqueryUI instead
34-
//@import "vendor/bootstrap/tooltip"; // we do our own
3529
@import "vendor/bootstrap/popovers";
3630

3731
// Components: Misc

app/stylesheets/bundles/common.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
@import "vendor/flexboxgrid";
1111

1212
// Canvas components and area-specific styles
13+
@import "components/alerts";
1314
@import "components/buttons";
1415
@import "components/g_base";
1516
@import "components/accordion";

app/stylesheets/components/_alerts.scss

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,52 @@
4949
5050
*/
5151

52+
// Alerts
53+
////////////////////////
54+
55+
56+
// Base styles
57+
58+
.alert {
59+
padding: $ic-sp $ic-sp*3 $ic-sp $ic-sp;
60+
background-color: $ic-bg-light-alert;
61+
color: $ic-color-alert;
62+
border-radius: $ic-border-radius;
63+
}
64+
.alert h4 {
65+
margin: 0;
66+
}
67+
68+
// Adjust close link position
69+
70+
.alert .close {
71+
position: relative;
72+
top: -2px;
73+
right: -21px;
74+
line-height: $baseLineHeight;
75+
}
76+
77+
// Alternate State Colors
78+
79+
.alert-success {
80+
background-color: $ic-bg-light-success;
81+
color: $successText;
82+
}
83+
.alert-danger,
84+
.alert-error {
85+
background-color: $ic-bg-light-danger;
86+
color: $ic-color-danger;
87+
}
88+
.alert-info {
89+
background-color: $ic-bg-light-primary;
90+
color: $ic-brand-primary;
91+
}
92+
93+
//// end Alerts
94+
95+
//// Flash Notifications
96+
////////////////////////
97+
5298
.ic-flash-info, .ic-flash-success, .ic-flash-warning, .ic-flash-error {
5399
position: relative;
54100

app/stylesheets/vendor/bootstrap/_alerts.scss

Lines changed: 0 additions & 65 deletions
This file was deleted.

0 commit comments

Comments
 (0)