Skip to content

Commit b281e27

Browse files
author
Conrad Chan
authored
fix(avatar): Update colors to be a11y contrast ratio compliant (#2767)
1 parent 0befafd commit b281e27

5 files changed

Lines changed: 5 additions & 25 deletions

File tree

src/components/avatar/__tests__/AvatarInitials.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe('components/avatar/AvatarInitials', () => {
3232

3333
test('should set data-bg-idx attribute based on id', () => {
3434
const wrapper = shallow(<AvatarInitials id="10" name="hello world" />);
35-
expect(wrapper.prop('data-bg-idx')).toEqual(1);
35+
expect(wrapper.prop('data-bg-idx')).toEqual(4);
3636
});
3737

3838
test('should set a default data-bg-idx attribute if no id is passed in', () => {

src/styles/constants/_themes.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
$avatar-colors: $bdl-light-blue, $bdl-box-blue, $bdl-dark-blue, $bdl-gray-62, $bdl-green-light, $bdl-yellorange, $bdl-grimace, $bdl-purple-rain, $bdl-watermelon-red;
1+
$avatar-colors: $bdl-box-blue, $bdl-dark-blue, $bdl-gray-62, $bdl-gray, $bdl-grimace, $bdl-purple-rain;

src/styles/variables.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export const bdlLineHeight = "20px"; // bdl-line-height
8282
export const bdlFontSize = "13px"; // bdl-fontSize
8383
export const bdlFontSizeMinimum = "11px"; // bdl-fontSize-minimum
8484
export const bdlFontSizeDejaBlue = "14px"; // bdl-fontSize--dejaBlue
85-
export const avatarColors = ["#2486fc","#0061d5","#003c84","#767676","#26c281","#f5b31b","#4826c2","#9f3fed","#ed3757"]; // avatar-colors
85+
export const avatarColors = ["#0061d5","#003c84","#767676","#222","#4826c2","#9f3fed"]; // avatar-colors
8686
export const modalDialogZIndex = "160"; // modal-dialog-z-index
8787
export const menuZIndex = "170"; // menu-z-index
8888
export const notificationsWrapperZIndex = "180"; // notifications-wrapper-z-index

src/styles/variables.json

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,7 @@
7979
"bdl-fontSize": "13px",
8080
"bdl-fontSize-minimum": "11px",
8181
"bdl-fontSize--dejaBlue": "14px",
82-
"avatar-colors": [
83-
"#2486fc",
84-
"#0061d5",
85-
"#003c84",
86-
"#767676",
87-
"#26c281",
88-
"#f5b31b",
89-
"#4826c2",
90-
"#9f3fed",
91-
"#ed3757"
92-
],
82+
"avatar-colors": ["#0061d5", "#003c84", "#767676", "#222", "#4826c2", "#9f3fed"],
9383
"modal-dialog-z-index": "160",
9484
"menu-z-index": "170",
9585
"notifications-wrapper-z-index": "180",

src/styles/variables.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,7 @@ export const bdlLineHeight = '20px'; // bdl-line-height
7979
export const bdlFontSize = '13px'; // bdl-fontSize
8080
export const bdlFontSizeMinimum = '11px'; // bdl-fontSize-minimum
8181
export const bdlFontSizeDejaBlue = '14px'; // bdl-fontSize--dejaBlue
82-
export const avatarColors = [
83-
'#2486fc',
84-
'#0061d5',
85-
'#003c84',
86-
'#767676',
87-
'#26c281',
88-
'#f5b31b',
89-
'#4826c2',
90-
'#9f3fed',
91-
'#ed3757',
92-
]; // avatar-colors
82+
export const avatarColors = ['#0061d5', '#003c84', '#767676', '#222', '#4826c2', '#9f3fed']; // avatar-colors
9383
export const modalDialogZIndex = '160'; // modal-dialog-z-index
9484
export const menuZIndex = '170'; // menu-z-index
9585
export const notificationsWrapperZIndex = '180'; // notifications-wrapper-z-index

0 commit comments

Comments
 (0)