mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
* 🔧 Upgrade to storybook 9.x * 🔧 Upgrade to storybook 10.x * 🔧 Update watch:storybook script so it builds its assets dependencies first * 🔧 Use vitest for storybook tests (test-storybook was deprecated)
43 lines
784 B
JavaScript
43 lines
784 B
JavaScript
import { withThemeByClassName } from "@storybook/addon-themes";
|
|
|
|
import '../resources/public/css/ds.css';
|
|
|
|
export const decorators = [
|
|
withThemeByClassName({
|
|
themes: {
|
|
light: "light",
|
|
dark: "default",
|
|
},
|
|
defaultTheme: "dark",
|
|
parentSelector: "body",
|
|
}),
|
|
];
|
|
|
|
/** @type { import('@storybook/react-vite').Preview } */
|
|
const preview = {
|
|
decorators: decorators,
|
|
|
|
parameters: {
|
|
controls: {
|
|
disableSaveFromUI: true,
|
|
matchers: {
|
|
color: /(background|color)$/i,
|
|
date: /Date$/i,
|
|
},
|
|
},
|
|
backgrounds: {
|
|
options: {
|
|
theme: { name: 'theme', value: 'var(--color-background-secondary)' }
|
|
}
|
|
},
|
|
},
|
|
|
|
initialGlobals: {
|
|
backgrounds: {
|
|
value: "theme"
|
|
}
|
|
}
|
|
};
|
|
|
|
export default preview;
|