Skip to content

Add support for a dark mode on modelviewer.dev documentation #5190

Description

@streetcodec

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 :

Demo.dark.mode.model.viewer.webm

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions