Skip to content

Commit 86a513f

Browse files
authored
fix: improve dark mode neutral background contrast (#2039)
1 parent 597e978 commit 86a513f

File tree

7 files changed

+9
-11
lines changed

7 files changed

+9
-11
lines changed

packages/loaders/src/elements/Progress.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ describe('Progress', () => {
8080
describe('without a color set', () => {
8181
it.each<['light' | 'dark', string, string]>([
8282
['light', rgba(PALETTE.grey[700], DEFAULT_THEME.opacity[200]), PALETTE.green[700]],
83-
['dark', rgba(PALETTE.grey[500], DEFAULT_THEME.opacity[200]), PALETTE.green[600]]
83+
['dark', rgba(PALETTE.white, DEFAULT_THEME.opacity[200]), PALETTE.green[600]]
8484
])('applies the default colors in "%s mode', (mode, bgColor, fgColor) => {
8585
const { container } = getRenderFn(mode)(<Progress value={42} />);
8686

packages/loaders/src/elements/Skeleton.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('Skeleton', () => {
1616

1717
it.each<Args>([
1818
['light', rgba(PALETTE.grey[700], DEFAULT_THEME.opacity[200])],
19-
['dark', rgba(PALETTE.grey[500], DEFAULT_THEME.opacity[200])]
19+
['dark', rgba(PALETTE.white, DEFAULT_THEME.opacity[200])]
2020
])('renders a Skeleton in "%s" mode', (mode, color) => {
2121
const { container } = getRenderFn(mode)(<Skeleton />);
2222

packages/loaders/src/styled/StyledProgress.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,9 @@ const colorStyles = ({
3535
}: IStyledProgressBackgroundProps & ThemeProps<DefaultTheme>) => {
3636
const backgroundColor = getColor({
3737
theme,
38-
hue: 'neutralHue',
3938
transparency: theme.opacity[200],
40-
light: { shade: 700 },
41-
dark: { shade: 500 }
39+
light: { hue: 'neutralHue', shade: 700 },
40+
dark: { hue: 'white' }
4241
});
4342
let options;
4443

packages/loaders/src/styled/StyledSkeleton.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,9 @@ const getBackgroundColor = ({
5959
} else {
6060
backgroundColor = getColor({
6161
theme,
62-
hue: 'neutralHue',
6362
transparency: theme.opacity[200],
64-
light: { shade: 700 },
65-
dark: { shade: 500 }
63+
light: { hue: 'neutralHue', shade: 700 },
64+
dark: { hue: 'white' }
6665
});
6766
}
6867
return backgroundColor;

packages/theming/src/elements/theme/__snapshots__/index.spec.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ exports[`DEFAULT_THEME matches snapshot 1`] = `
3838
"danger": "dangerHue.1000",
3939
"dangerEmphasis": "dangerHue.600",
4040
"default": "neutralHue.1100",
41-
"disabled": "rgba(neutralHue.500, 100)",
41+
"disabled": "rgba(white, 100)",
4242
"emphasis": "neutralHue.600",
4343
"primaryEmphasis": "primaryHue.600",
4444
"raised": "neutralHue.1000",

packages/theming/src/elements/theme/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const colors = {
6060
successEmphasis: 'successHue.600',
6161
warningEmphasis: 'warningHue.600',
6262
dangerEmphasis: 'dangerHue.600',
63-
disabled: 'rgba(neutralHue.500, 100)'
63+
disabled: 'rgba(white, 100)'
6464
},
6565
border: {
6666
default: 'neutralHue.800',

packages/theming/src/utils/getColor.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ describe('getColor', () => {
6666
variable: 'background.disabled'
6767
});
6868
const transparency = 0.08;
69-
const expected = rgba(PALETTE.grey[mode === 'dark' ? 500 : 700], transparency);
69+
const expected = rgba(mode === 'dark' ? PALETTE.white : PALETTE.grey[700], transparency);
7070

7171
expect(color).toBe(expected);
7272
});

0 commit comments

Comments
 (0)