Skip to content

[FE-48] Dark mode support (light/dark/system toggle) #1306

Description

@yusuftomilola

Overview

The platform has no dark mode. Many developers and late-night workers who use coworking spaces prefer dark mode for eye comfort. Without it, the platform feels less polished than competitors and ignores the OS-level preference set by a large share of users.

Context

  • frontend/app/globals.css — where CSS custom properties are defined; dark mode tokens go here
  • frontend/app/layout.tsx — where data-theme attribute is applied to <html>
  • The design uses Tailwind CSS — use dark: variant classes and/or CSS variable overrides

Tasks

  • Create frontend/lib/store/themeStore.ts Zustand store with theme: 'light' | 'dark' | 'system' and setTheme(theme) action
  • In frontend/app/layout.tsx: on mount, read themeStore.theme and apply document.documentElement.setAttribute('data-theme', resolvedTheme) where resolvedTheme is 'dark' if system preference is dark and theme === 'system'
  • Add dark mode CSS variable overrides in globals.css using [data-theme="dark"] { ... } selector:
    • Background colors, text colors, border colors, card backgrounds, sidebar background, input backgrounds
  • Create frontend/components/ui/ThemeToggle.tsx — a three-way toggle button: Sun (Light) / Monitor (System) / Moon (Dark); calls themeStore.setTheme()
  • Add ThemeToggle to the user avatar dropdown menu in the navbar
  • Audit all components for hardcoded color values (e.g. bg-white, text-gray-900 without dark variants) and replace with CSS variable-based classes or add dark: equivalents
  • Persist theme preference in localStorage so it survives page refresh

Files to Modify / Create

  • New: frontend/lib/store/themeStore.ts
  • New: frontend/components/ui/ThemeToggle.tsx
  • frontend/app/globals.css
  • frontend/app/layout.tsx
  • Various component files (audit needed)

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions