From 4456e53aa3e8cf46ee125c861a451eae670ac3b7 Mon Sep 17 00:00:00 2001 From: Gabriel Collares <98597812+GabrielCollares@users.noreply.github.com> Date: Wed, 17 Jul 2024 00:01:52 -0300 Subject: [PATCH] fix: adjust theme and preview of the storybook (#46) --- .storybook/preview.ts | 17 ++++++++++++----- .storybook/themes.css | 3 +++ 2 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 .storybook/themes.css diff --git a/.storybook/preview.ts b/.storybook/preview.ts index 5ac30a9..f4d737a 100644 --- a/.storybook/preview.ts +++ b/.storybook/preview.ts @@ -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: { @@ -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', })] diff --git a/.storybook/themes.css b/.storybook/themes.css new file mode 100644 index 0000000..059064e --- /dev/null +++ b/.storybook/themes.css @@ -0,0 +1,3 @@ +.theme-dark { + background-color: #0f0f0f; +} \ No newline at end of file