Set the initial Storybook theme to light (#711)
This fixes the inconsistency if user's OS/Browser theme is set to Dark mode.
This commit is contained in:
@@ -1,14 +1,21 @@
|
||||
import React from 'react';
|
||||
import { addDecorator } from '@storybook/react';
|
||||
import { addDecorator, addParameters } from '@storybook/react';
|
||||
import { lightTheme, darkTheme } from '@backstage/theme';
|
||||
import { CssBaseline, ThemeProvider } from '@material-ui/core';
|
||||
import { useDarkMode } from 'storybook-dark-mode';
|
||||
import { Content } from '@backstage/core';
|
||||
|
||||
addDecorator(story => (
|
||||
addDecorator((story) => (
|
||||
<ThemeProvider theme={useDarkMode() ? darkTheme : lightTheme}>
|
||||
<CssBaseline>
|
||||
<Content>{story()}</Content>
|
||||
</CssBaseline>
|
||||
</ThemeProvider>
|
||||
));
|
||||
|
||||
addParameters({
|
||||
darkMode: {
|
||||
// Set the initial theme
|
||||
current: 'light',
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user