Skip to content

Feat/implement dark mode system for merchant dashbaord#130

Open
Ekene001 wants to merge 3 commits into0xdevcollins:mainfrom
Ekene001:feat/implement-dark-mode-system-for-merchant-dashbaord
Open

Feat/implement dark mode system for merchant dashbaord#130
Ekene001 wants to merge 3 commits into0xdevcollins:mainfrom
Ekene001:feat/implement-dark-mode-system-for-merchant-dashbaord

Conversation

@Ekene001
Copy link
Copy Markdown
Contributor

@Ekene001 Ekene001 commented Apr 5, 2026

closes #88

Dark Mode System for Merchant Dashboard

Implements a full production-ready dark mode system for the merchant dashboard with system preference detection, manual toggle, localStorage persistence, and CSS variable-based theming across all components.

Changes

Theme Infrastructure

  • Extended ThemeProvider to support three modes: light, dark, and system (auto-detects OS preference via matchMedia)
  • Theme persisted to localStorage under useroutr-theme key
  • Added toggleTheme() cycling light → dark → system, plus setPreference() for direct selection
  • Added inline flash-prevention <script> in root layout.tsx to apply theme class before first paint

CSS Token System (globals.css)

  • Added dark mode semantic tokens: --bg-page, --bg-card, --bg-sidebar, --text-primary, --text-secondary, --border-color, --input-bg, --input-border, --code-bg
  • Added chart tokens: --chart-tick, --chart-grid, --chart-tooltip-bg, --chart-tooltip-text, --chart-tooltip-border
  • Added status tokens: --status-success-bg/text, --status-warning-bg/text, --status-error-bg/text, --status-info-bg/text, --status-purple-bg/text, --status-amber-bg/text
  • Registered all tokens in @theme inline block for Tailwind v4 utility class support
  • Defined :root (dark-first) and .light overrides

Theme Toggle UI

  • Updated site-header.tsx and Topbar.tsx with 3-way toggle button (Sun / Moon / Monitor icons from lucide-react)
  • Each mode shows tooltip label and appropriate aria-label

Component Fixes (removed all hardcoded colors)

  • [AnalyticsDashboard.tsx] — chart grid, axis, tooltip, bar fills, heatmap all use CSS vars
  • InvoiceDetailSheet.tsx — status badges use bg-status-* / text-status-* tokens
  • InvoicesTable.tsx — same status badge token migration
  • InvoiceDrawer.tsx — discount color uses status token
  • MetricCard.tsx — delta badges and sparkline strokes use status tokens
  • GreetingHeader.tsx — live indicator uses text-status-success-text
  • (auth)/layout.tsx — gradient background uses CSS vars instead of rgba()
  • QRCodeModal.tsx / LinkCreatedModal.tsx — bg-white → bg-card

Ekene001 added 3 commits April 5, 2026 23:06
- Refactored theme management in ThemeProvider to support user preferences (light, dark, system).
- Updated Topbar and SiteHeader components to reflect theme changes with appropriate icons and tooltips.
- Enhanced InvoicesTable and InvoiceDrawer components with consistent status badge styling.
- Adjusted QR code modal and link creation components for improved visual consistency.
- Fixed encoding issues in InvoiceDrawer and GreetingHeader components.
- Improved accessibility by adding aria-labels and titles for theme toggle buttons.
…/implement-dark-mode-system-for-merchant-dashbaord
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dashboard: Dark Mode Theme Implementation

1 participant