Skip to content

Fix login page to honor system dark mode setting#1728

Merged
jundot merged 1 commit into
jundot:mainfrom
monroewilliams:fix/login-dark-mode
Jun 8, 2026
Merged

Fix login page to honor system dark mode setting#1728
jundot merged 1 commit into
jundot:mainfrom
monroewilliams:fix/login-dark-mode

Conversation

@monroewilliams

Copy link
Copy Markdown
Contributor

Problem

The login page on the admin endpoint didn't honor the system dark mode setting, unlike the chat and dashboard pages.

Root Cause

The theme initialization script in base.html was defaulting to 'light' and never checking prefers-color-scheme when the stored theme value was 'auto'.

Fix

Updated the inline theme script in base.html to:

  • Default to 'auto' instead of 'light' when no theme is stored in localStorage
  • Check window.matchMedia('(prefers-color-scheme: dark)') when the theme is 'auto' to detect the system dark mode preference

This matches the behavior already used by chat.html.

The base template's theme initialization script was defaulting to 'light'
and never checking prefers-color-scheme. Updated it to default to 'auto'
and detect system dark mode via window.matchMedia, matching the behavior
of the chat and dashboard pages.
@jundot

jundot commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Thanks for the fix. The base template now matches the chat/dashboard auto-theme behavior for initial render, and it keeps explicit light/dark choices unchanged. This looks good to me, and I'm going to merge it.

@jundot jundot merged commit 4caf93a into jundot:main Jun 8, 2026
4 checks passed
@monroewilliams monroewilliams deleted the fix/login-dark-mode branch June 8, 2026 19:42
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