Skip to content

Commit f3fc231

Browse files
committed
feat(landing): add theme provider with light/dark mode
- ThemeProvider using next-themes - wrap App with ThemeProvider + TooltipProvider - light mode CSS variables for backgrounds, text, accents - accordion animations in tailwind config
1 parent acb231e commit f3fc231

4 files changed

Lines changed: 92 additions & 5 deletions

File tree

frontend/src/App.tsx

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom';
22
import { AuthProvider, useAuth } from './contexts/AuthContext';
3+
import { ThemeProvider } from './components/providers/ThemeProvider';
4+
import { TooltipProvider } from './components/ui/tooltip';
35
import { LoginPage } from './pages/LoginPage';
46
import { SignupPage } from './pages/SignupPage';
57
import { LandingPage } from './pages/LandingPage';
@@ -80,10 +82,19 @@ function AppRoutes() {
8082

8183
export function App() {
8284
return (
83-
<BrowserRouter>
84-
<AuthProvider>
85-
<AppRoutes />
86-
</AuthProvider>
87-
</BrowserRouter>
85+
<ThemeProvider
86+
attribute="class"
87+
defaultTheme="dark"
88+
enableSystem={false}
89+
disableTransitionOnChange
90+
>
91+
<TooltipProvider>
92+
<BrowserRouter>
93+
<AuthProvider>
94+
<AppRoutes />
95+
</AuthProvider>
96+
</BrowserRouter>
97+
</TooltipProvider>
98+
</ThemeProvider>
8899
);
89100
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
"use client"
2+
3+
import { ThemeProvider as NextThemesProvider } from "next-themes"
4+
import { type ThemeProviderProps } from "next-themes"
5+
6+
export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
7+
return <NextThemesProvider {...props}>{children}</NextThemesProvider>
8+
}

frontend/src/index.css

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,64 @@
126126
--chart-5: 340 75% 55%;
127127
}
128128

129+
/* Light mode overrides */
130+
.light {
131+
/* Background */
132+
--color-bg-primary: #ffffff;
133+
--color-bg-secondary: #f8fafc;
134+
--color-bg-tertiary: #f1f5f9;
135+
--color-bg-hover: #e2e8f0;
136+
137+
/* Text */
138+
--color-text-primary: #0f172a;
139+
--color-text-secondary: #475569;
140+
--color-text-muted: #64748b;
141+
--color-text-disabled: #94a3b8;
142+
143+
/* Accent (same hue, adjusted for light bg) */
144+
--color-accent: #4f46e5;
145+
--color-accent-hover: #6366f1;
146+
--color-accent-muted: #818cf8;
147+
--color-accent-glow: rgba(79, 70, 229, 0.12);
148+
149+
/* Border */
150+
--color-border: #e2e8f0;
151+
--color-border-muted: #f1f5f9;
152+
--color-border-accent: #4f46e5;
153+
154+
/* Glass (adjusted for light) */
155+
--glass-bg: rgba(0, 0, 0, 0.02);
156+
--glass-bg-hover: rgba(0, 0, 0, 0.04);
157+
--glass-border: rgba(0, 0, 0, 0.06);
158+
--glass-border-hover: rgba(0, 0, 0, 0.1);
159+
160+
/* Shadow (lighter for light mode) */
161+
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
162+
--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
163+
--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
164+
165+
/* Shadcn HSL overrides */
166+
--background: 0 0% 100%;
167+
--foreground: 222 47% 11%;
168+
--card: 0 0% 100%;
169+
--card-foreground: 222 47% 11%;
170+
--popover: 0 0% 100%;
171+
--popover-foreground: 222 47% 11%;
172+
--primary: 243 75% 59%;
173+
--primary-foreground: 0 0% 100%;
174+
--secondary: 210 40% 96%;
175+
--secondary-foreground: 222 47% 11%;
176+
--muted: 210 40% 96%;
177+
--muted-foreground: 215 16% 47%;
178+
--accent: 210 40% 96%;
179+
--accent-foreground: 222 47% 11%;
180+
--destructive: 0 84% 60%;
181+
--destructive-foreground: 0 0% 100%;
182+
--border: 214 32% 91%;
183+
--input: 214 32% 91%;
184+
--ring: 243 75% 59%;
185+
}
186+
129187
* {
130188
@apply border-border;
131189
}

frontend/tailwind.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ export default {
157157
'blur-in': 'blur-in var(--duration-slow) var(--ease-out-expo) forwards',
158158
'glow-pulse': 'glow-pulse 2s var(--ease-in-out) infinite',
159159
shimmer: 'shimmer 2s infinite',
160+
'accordion-down': 'accordion-down 0.2s ease-out',
161+
'accordion-up': 'accordion-up 0.2s ease-out',
160162
},
161163

162164
keyframes: {
@@ -184,6 +186,14 @@ export default {
184186
'0%': { backgroundPosition: '-200% 0' },
185187
'100%': { backgroundPosition: '200% 0' },
186188
},
189+
'accordion-down': {
190+
from: { height: '0' },
191+
to: { height: 'var(--radix-accordion-content-height)' },
192+
},
193+
'accordion-up': {
194+
from: { height: 'var(--radix-accordion-content-height)' },
195+
to: { height: '0' },
196+
},
187197
},
188198
},
189199
},

0 commit comments

Comments
 (0)