mirror of
https://github.com/penpot/penpot.git
synced 2025-06-05 14:41:40 +02:00
✨ Support theme switching within Storybook
This commit is contained in:
parent
0d8c98dcfe
commit
ebda46f748
10 changed files with 62 additions and 70 deletions
|
@ -1,5 +1,19 @@
|
|||
import { withThemeByClassName } from "@storybook/addon-themes";
|
||||
|
||||
export const decorators = [
|
||||
withThemeByClassName({
|
||||
themes: {
|
||||
light: "light",
|
||||
dark: "default",
|
||||
},
|
||||
defaultTheme: "dark",
|
||||
parentSelector: "body",
|
||||
}),
|
||||
];
|
||||
|
||||
/** @type { import('@storybook/react').Preview } */
|
||||
const preview = {
|
||||
decorators: decorators,
|
||||
parameters: {
|
||||
controls: {
|
||||
matchers: {
|
||||
|
@ -7,23 +21,7 @@ const preview = {
|
|||
date: /Date$/i,
|
||||
},
|
||||
},
|
||||
backgrounds: {
|
||||
default: "dark",
|
||||
values: [
|
||||
{
|
||||
name: "dark",
|
||||
value: "#18181a",
|
||||
},
|
||||
{
|
||||
name: "light",
|
||||
value: "#fff",
|
||||
},
|
||||
{
|
||||
name: "debug",
|
||||
value: "#ccc",
|
||||
},
|
||||
],
|
||||
},
|
||||
backgrounds: { disable: true },
|
||||
},
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue