Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 10, 2026

Implements dark mode toggling with localStorage persistence. Users can select light, dark, or system-preference themes via a new settings page.

Implementation

Theme Management

  • UserSettingsProvider manages theme state and syncs with document.documentElement.classList
  • Monitors system preference via matchMedia('prefers-color-scheme: dark)'
  • Persists selection to localStorage using existing scoped key pattern

UI Changes

  • New /settings route with theme selector (light/dark/system radio buttons)
  • Settings accessible via gear icon in header (always visible) and user dropdown menu (when authenticated)
  • Dark mode styles applied to header, homepage, and list components using Tailwind dark: variants

Developer Experience

  • Tailwind configured with darkMode: 'class'
  • DARK_MODE.md documents the pattern and color palette for extending dark mode to additional components

Pattern

// Standard dark mode pattern used throughout
className="bg-white dark:bg-gray-800 
           text-gray-900 dark:text-white
           border-gray-200 dark:border-gray-700"

Screenshots

Settings Page

Light Dark
Settings Light Settings Dark

Homepage

Light Dark
Homepage Light Homepage Dark
Original prompt

Add dark mode.
Create a user settings page where a user can select their preferences. Preferences get stored in local storage.

You may need to reactor in many places to support dark mode so create patterns that are easy to repeat.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@netlify
Copy link

netlify bot commented Jan 10, 2026

Deploy Preview for competition-groups ready!

Name Link
🔨 Latest commit 6d459b1
🔍 Latest deploy log https://app.netlify.com/projects/competition-groups/deploys/6963e434297b2b0008f18acb
😎 Deploy Preview https://deploy-preview-54--competition-groups.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 71
Accessibility: 83
Best Practices: 100
SEO: 98
PWA: 90
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI and others added 3 commits January 10, 2026 17:58
- Configure Tailwind CSS with dark mode class strategy
- Create UserSettingsProvider for managing theme preferences
- Add Settings page with theme selector (light/dark/system)
- Update Header and RootLayout with dark mode styles
- Persist theme preference to localStorage
- Add settings link to header navigation

Co-authored-by: coder13 <[email protected]>
- Update CompetitionListItem with dark mode background and text colors
- Add dark mode support to Home page links and text
- Update UpcomingCompetitions error messages and buttons
- Add dark mode to CompetitionList titles and empty states
- Update LastFetchedAt component with dark mode text
- Update test snapshots for dark mode classes

Co-authored-by: coder13 <[email protected]>
- Create DARK_MODE.md with implementation patterns
- Document architecture and theme management
- Provide examples and best practices
- Include accessibility guidelines
- Add color palette reference

Co-authored-by: coder13 <[email protected]>
Copilot AI changed the title [WIP] Add user settings page for dark mode preference Add dark mode with user settings page Jan 10, 2026
Copilot AI requested a review from coder13 January 10, 2026 18:06
@coder13 coder13 marked this pull request as ready for review January 10, 2026 20:50
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.

2 participants