Skip to content

Commit

Permalink
fix: adjust theme and preview of the storybook (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielCollares authored Jul 17, 2024
1 parent 1badcba commit 4456e53
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
17 changes: 12 additions & 5 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import type { Preview } from "@storybook/react";
import "../src/index.css";
import "./themes.css"

import { withThemeByClassName } from "@storybook/addon-themes";



const preview: Preview = {
tags: ['autodocs'],
parameters: {
Expand All @@ -14,12 +13,20 @@ const preview: Preview = {
date: /Date$/i,
},
},
backgrounds: {
default: 'dark',
values: [
{
name: 'dark',
value: '#0f0f0f',
},
],
},
},

decorators: [withThemeByClassName({
themes: {
light: 'light',
dark: 'dark',
light: 'theme-light',
dark: 'theme-dark',
},
defaultTheme: 'dark',
})]
Expand Down
3 changes: 3 additions & 0 deletions .storybook/themes.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.theme-dark {
background-color: #0f0f0f;
}

0 comments on commit 4456e53

Please sign in to comment.