Add support for a dark mode on modelviewer.dev documentation

Author: streetcodecCreated Jul 30, 2026Updated Aug 2, 2026

Hi! I'd like to contribute a dark mode for the documentation site (modelviewer.dev) and wanted to get feedback before opening a PR. I think it is high time that model viewer doc gets a dark mode, as long reading on white mode hurts my eyes at least.

I have a working prototype that:

  • Supports both prefers-color-scheme and a manual theme toggle.
  • Persists the user's preference using localStorage.
  • Adds a theme toggle button to the docs.

At the moment this is just a prototype to demonstrate the feature. I've only handled the main model-viewer logo so far; the remaining icons (check, warning, etc.) and other UI polish would be completed before submitting the PR.

Would a dark mode be a welcome addition to the documentation? Also, is the current toggle/button placement acceptable, or would you prefer a different UI or implementation approach? @diegoteran

I'd be happy to refine it based on your feedback before opening the PR.

Demo :

https://github.com/user-attachments/assets/12fba520-322f-43f2-bdf5-e39aa17db7a6