From 36ca630a2c82cb5177a35f07a9901df52ce7f458 Mon Sep 17 00:00:00 2001 From: seb Date: Tue, 23 Jun 2026 11:26:37 +0200 Subject: [PATCH] theme --- index.html | 8 ++++++++ src/App.jsx | 1 + src/colors.js | 2 ++ src/components/AppShell.jsx | 37 ++++++++++++++++++++++++++++-------- src/components/LoginPage.jsx | 2 +- src/index.css | 6 ++++++ src/main.jsx | 8 +++----- src/theme.js | 25 ++++++++++++++++++++++++ 8 files changed, 75 insertions(+), 14 deletions(-) create mode 100644 src/colors.js create mode 100644 src/index.css create mode 100644 src/theme.js diff --git a/index.html b/index.html index f27d0e4..b1ead03 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,14 @@ Dashfront +
diff --git a/src/App.jsx b/src/App.jsx index cd85405..1235a89 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -18,6 +18,7 @@ export default function App() { alignItems: 'center', justifyContent: 'center', minHeight: '100vh', + bgcolor: 'background.default', }} > diff --git a/src/colors.js b/src/colors.js new file mode 100644 index 0000000..d012e4c --- /dev/null +++ b/src/colors.js @@ -0,0 +1,2 @@ +// Mirrored in index.html and index.css for paint before JS loads. +export const MAIN_BACKGROUND = '#dceeea'; diff --git a/src/components/AppShell.jsx b/src/components/AppShell.jsx index 85635b7..efd9d0d 100644 --- a/src/components/AppShell.jsx +++ b/src/components/AppShell.jsx @@ -11,16 +11,16 @@ const SIDEBAR_WIDTH = 240; export default function AppShell() { return ( - + ({ width: SIDEBAR_WIDTH, flexShrink: 0, display: 'flex', flexDirection: 'column', - bgcolor: 'background.paper', - }} + bgcolor: theme.nav.background, + })} > {NAV_ITEMS.map(({ path, label, icon: Icon }) => ( @@ -29,11 +29,24 @@ export default function AppShell() { component={NavLink} to={path} end={path === '/'} - sx={{ + sx={(theme) => ({ borderRadius: 0, px: 2, - '&.active': { bgcolor: 'action.selected' }, - }} + py: 1.25, + color: theme.nav.item, + '& .MuiListItemIcon-root': { color: 'inherit' }, + '&:hover': { + bgcolor: theme.nav.itemHover, + color: theme.nav.itemHoverText, + }, + '&.active': { + bgcolor: theme.nav.itemActive, + color: theme.nav.itemActiveText, + fontWeight: 600, + borderLeft: `3px solid ${theme.nav.itemActiveAccent}`, + pl: '13px', + }, + })} > @@ -46,7 +59,15 @@ export default function AppShell() { - + ({ + flexGrow: 1, + py: 4, + px: 3, + bgcolor: theme.nav.mainBackground, + })} + > diff --git a/src/components/LoginPage.jsx b/src/components/LoginPage.jsx index 34bf35c..c1e8dde 100644 --- a/src/components/LoginPage.jsx +++ b/src/components/LoginPage.jsx @@ -37,7 +37,7 @@ export default function LoginPage() { alignItems: 'center', justifyContent: 'center', minHeight: '100vh', - bgcolor: 'grey.100', + bgcolor: 'background.default', }} >