Skip to content

Conversation

@harmitgoswami
Copy link
Contributor

Fix #3339

This PR changes the default theme for all users to match their system preferences, regardless of if they're an authenticated user.

To reproduce results: After running the server, open localhost:8000 in a new tab. Then, go into your computer's system settings and switch your preferred theme to the opposite of what you currently have selected. You should see Pontoon's theme also change at the same time you switch your preferred theme.

Copy link
Collaborator

@mathjazz mathjazz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

I noticed two issues when using the light system theme:

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 52.17391% with 11 lines in your changes missing coverage. Please review.

Project coverage is 78.95%. Comparing base (948e6cf) to head (74748da).
Report is 13 commits behind head on main.

Additional details and impacted files

Copy link
Collaborator

@mathjazz mathjazz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

The only remaining issue is that if a system theme is set to light, users will experience FOUC when logged out.

We must still be defaulting to the dark theme somewhere, and need to make sure we honour prefers-color-scheme before the page renders.

@mathjazz
Copy link
Collaborator

Superseded by #3649.

@mathjazz mathjazz closed this May 22, 2025
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.

Pontoon should use light theme for visitors requesting light theme

3 participants