Skip to content

Theme toggle ignores prefers-color-scheme on first visit #135

Description

@yakew7

index.html, profiler.html, and every explainer page run:

const saved = localStorage.getItem('fc-theme') || 'light';

A first-time visitor with a dark-mode OS/browser preference still gets the light theme by default until they manually toggle it.

Request: fall back to window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light' instead of a hardcoded 'light' default, only when nothing is saved in localStorage yet (an explicit prior choice should still win).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions