Skip to content

Commit

Permalink
feat: add storybook themes
Browse files Browse the repository at this point in the history
  • Loading branch information
TomatoVan committed Mar 16, 2024
1 parent 9c1f957 commit 468cd13
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
8 changes: 7 additions & 1 deletion config/storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ module.exports = {
],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
{
name: '@storybook/addon-essentials',
options: {
backgrounds: false,
},
},
'@storybook/addon-interactions',
'storybook-addon-mock/register',
'storybook-addon-themes',
],
framework: '@storybook/react',
core: {
Expand Down
9 changes: 9 additions & 0 deletions config/storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ export const parameters = {
},
},
layout: 'fullscreen',
themes: {
default: 'light',
list: [
{ name: 'light', class: Theme.LIGHT, color: '#ffffff' },
{ name: 'dark', class: Theme.DARK, color: '#000000' },
{ name: 'orange', class: Theme.ORANGE, color: '#ffb005' },
],
},

};

addDecorator(StyleDecorator);
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@
"@vitejs/plugin-react": "^2.1.0",
"vite": "^3.1.0",
"vite-plugin-svgr": "^2.2.1",
"eslint-plugin-unused-imports": "^2.0.0"
"eslint-plugin-unused-imports": "^2.0.0",
"storybook-addon-themes": "^6.1.0"
},
"dependencies": {
"@reduxjs/toolkit": "^1.8.0",
Expand Down

0 comments on commit 468cd13

Please sign in to comment.