Skip to content

Commit

Permalink
feat: add storybook-addon-themes for switching themes
Browse files Browse the repository at this point in the history
  • Loading branch information
sashtje committed Sep 28, 2023
1 parent 33e2eca commit 6e6e658
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 1 deletion.
8 changes: 7 additions & 1 deletion config/storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ export default {
],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
{
name: '@storybook/addon-essentials',
options: {
background: false,
},
},
'@storybook/addon-interactions',
'storybook-addon-mock/register',
'storybook-addon-themes',
],
framework: '@storybook/react',
core: {
Expand Down
8 changes: 8 additions & 0 deletions config/storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ export const parameters = {
},
},
layout: 'fullscreen',
themes: {
default: 'light',
list: [
{ name: 'light', class: Theme.LIGHT, color: '#fff' },
{ name: 'dark', class: Theme.DARK, color: '#090949' },
{ name: 'orange', class: Theme.ORANGE, color: '#9a1a0e' },
],
},
};

addDecorator(StyleDecorator);
Expand Down
44 changes: 44 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
"sass": "^1.49.9",
"sass-loader": "^12.6.0",
"storybook-addon-mock": "^2.4.1",
"storybook-addon-themes": "^6.1.0",
"style-loader": "^3.3.1",
"stylelint": "^14.5.3",
"stylelint-config-standard-scss": "^3.0.0",
Expand Down

0 comments on commit 6e6e658

Please sign in to comment.