Skip to content

Commit c99dd32

Browse files
ellisiojoshwooding
authored andcommitted
[core] Remove redundant production check (#17929)
This extra if condition is redundant.
1 parent 0a6d9a5 commit c99dd32

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

packages/material-ui/src/styles/createPalette.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,14 @@ export default function createPalette(palette) {
119119

120120
if (process.env.NODE_ENV !== 'production') {
121121
const contrast = getContrastRatio(background, contrastText);
122-
if (process.env.NODE_ENV !== 'production') {
123-
if (contrast < 3) {
124-
console.error(
125-
[
126-
`Material-UI: the contrast ratio of ${contrast}:1 for ${contrastText} on ${background}`,
127-
'falls below the WACG recommended absolute minimum contrast ratio of 3:1.',
128-
'https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast',
129-
].join('\n'),
130-
);
131-
}
122+
if (contrast < 3) {
123+
console.error(
124+
[
125+
`Material-UI: the contrast ratio of ${contrast}:1 for ${contrastText} on ${background}`,
126+
'falls below the WACG recommended absolute minimum contrast ratio of 3:1.',
127+
'https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast',
128+
].join('\n'),
129+
);
132130
}
133131
}
134132

0 commit comments

Comments
 (0)