From 8ffa71859b6c08b79f643d7c99595eeb632e7ff0 Mon Sep 17 00:00:00 2001 From: samuelea Date: Tue, 17 Oct 2023 14:52:33 -0400 Subject: [PATCH] theming with theme object --- postcss.config.cjs => backpostcss.config.cjs | 0 .../ThemeProvider/ThemeProvider.stories.tsx | 3 +- .../ThemeProvider/ThemeProvider.tsx | 69 ++++--- src/components/ThemeProvider/index.ts | 1 + src/css/vars.css.ts | 10 +- src/tokens/color.ts | 171 ++++++++---------- src/tokens/index.ts | 35 ++-- 7 files changed, 140 insertions(+), 149 deletions(-) rename postcss.config.cjs => backpostcss.config.cjs (100%) diff --git a/postcss.config.cjs b/backpostcss.config.cjs similarity index 100% rename from postcss.config.cjs rename to backpostcss.config.cjs diff --git a/src/components/ThemeProvider/ThemeProvider.stories.tsx b/src/components/ThemeProvider/ThemeProvider.stories.tsx index 150e4b46a..f9e47bd0d 100644 --- a/src/components/ThemeProvider/ThemeProvider.stories.tsx +++ b/src/components/ThemeProvider/ThemeProvider.stories.tsx @@ -11,8 +11,9 @@ export default { export const Default = () => { const { theme, setTheme } = useTheme() + const toggleTheme = () => { - setTheme(theme === 'light' ? 'dark' : 'light') + setTheme(theme) } return