feat(ui): implement dark mode with theme toggle
- Add global theme state in App.tsx with localStorage persistence - Implement dark mode CSS variables in index.css - Add theme toggle button in sidebar navigation - Update Dashboard with dark mode support for stats cards and badges - Update Settings page with dark mode for main layout and toggles This implements the core dark mode functionality with separation of concerns - theme state is managed globally in App.tsx and passed down to child components as props.
This commit is contained in:
@@ -2,6 +2,38 @@
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
:root {
|
||||
--bg-color: #f8fafc;
|
||||
--bg-secondary: #f1f5f9;
|
||||
--text-primary: #0f172a;
|
||||
--text-secondary: #64748b;
|
||||
--accent-color: #6366f1;
|
||||
--accent-hover: #4f46e5;
|
||||
--border-color: #e2e8f0;
|
||||
--card-bg: #ffffff;
|
||||
--input-bg: #ffffff;
|
||||
--input-border: #e2e8f0;
|
||||
--success-color: #22c55e;
|
||||
--error-color: #ef4444;
|
||||
}
|
||||
|
||||
[data-theme="dark"] {
|
||||
--bg-color: #0f172a;
|
||||
--bg-secondary: #1e293b;
|
||||
--text-primary: #f1f5f9;
|
||||
--text-secondary: #94a3b8;
|
||||
--accent-color: #818cf8;
|
||||
--accent-hover: #6366f1;
|
||||
--border-color: #334155;
|
||||
--card-bg: #1e293b;
|
||||
--input-bg: #0f172a;
|
||||
--input-border: #334155;
|
||||
}
|
||||
|
||||
* {
|
||||
transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
|
||||
@@ -9,9 +41,13 @@ body {
|
||||
sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
background-color: var(--bg-color);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
|
||||
monospace;
|
||||
background-color: var(--bg-secondary);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user