UTDNebula / website

General documentation for Project Nebula, an initiative to build tools that help students.
https://www.utdnebula.com
MIT License
9 stars 11 forks source link

Respect system theme for dark/light mode #28

Open WillieCubed opened 2 years ago

WillieCubed commented 2 years ago

Overview

The website currently has a dark mode switch, but it defaults to using the light theme. It would be ideal if a user didn't have to update the switch to view the website in their preferred color scheme.

Proposal

The website should respect the user's color scheme (dark/light). Specifically, it should use the browser's built-in color scheme (dark/light) and use the system theme.

Supplementary Information

The Docusaurus docs should give enough information to resolve this.

Also, shout-out to @Jake3231 for catching this!

Jake3231 commented 2 years ago

It looks like the website correctly responds to system appearance changes, but returns to the default light theme upon reloading the page.

Tested: Safari for iOS 15.3.1 (Current release version) Safari for macOS 12.3 beta 3

Jake3231 commented 2 years ago

On both Chrome and Safari, the website may also intermittently load initially with the default appearance, while still responding to system appearance changes after that point.

michaelgrav commented 2 years ago

The website correctly responds to system appearance changes on my Mac as well, but on windows it does not respond to changes.

Tested: Firefox 97 for macOS (Current release version) Firefox 97 for Windows 10 (Also current release version)