Skip to content

Commit aedaaeb

Browse files
authored
fix: check null value
1 parent e24d5e1 commit aedaaeb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.storybook/preview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const preview: Preview = {
1717
decorators: [
1818
(Story, context) => {
1919
const bgValue = context.globals?.backgrounds?.value;
20-
const isDark = getColorLuminance(bgValue) < 0.5;
20+
const isDark = bgValue && getColorLuminance(bgValue) < 0.5;
2121
return (
2222
<AntdConfigProvider theme={{ algorithm: isDark ? theme.darkAlgorithm : theme.defaultAlgorithm }}>
2323
<AntdApp>

0 commit comments

Comments
 (0)