Skip to content

✨ add toggle for light/dark style - #733

Open
ctcpip wants to merge 1 commit into
mainfrom
dayandnightitossandturnikeepstressinmymindmind
Open

ctcpip wants to merge 1 commit into
mainfrom
dayandnightitossandturnikeepstressinmymindmind

Conversation

@ctcpip

@ctcpip ctcpip commented Sep 22, 2026

Copy link
Copy Markdown
Member

resolves #647

@ctcpip
ctcpip requested review from a team and bakkot September 22, 2026 23:16
@bakkot

bakkot commented Sep 22, 2026

Copy link
Copy Markdown
Member

Hm, this doesn't actually seem like it resolves that issue to me? If the problem is that you have a spec that has diagrams that are unreadable in dark mode, and you don't want to fix that, giving your users the ability to manually re-enable light mode after the page has loaded isn't much of a solution.

@gesa

gesa commented Sep 22, 2026

Copy link
Copy Markdown
Member

@bakkot multiple things can be true: we should figure out a way for graphics to render nicely in dark mode, and we shouldn't assume what users want to the degree that we don't allow them to choose.

@ctcpip

ctcpip commented Sep 22, 2026

Copy link
Copy Markdown
Member Author

@bakkot I completely agree. As stated in the issue:

We clearly have work to do, particularly to improve dark mode rendering. We should create a separate issue to track problems with dark mode.

Comment thread js/menu.js
Comment on lines +1168 to +1173
// a change to the system's scheme is a new preference, so go back to following it
systemPrefersDark.addEventListener('change', () => {
if (colorSchemeInverted) {
toggleColorScheme();
}
});

@nicolo-ribaudo nicolo-ribaudo Oct 23, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I switch between light and dark mode system-wide in the night (but I rarely look at ecma262 when that happens, so I almost never look at the dark mode version 😅).

It would be better if the states were light/dark/system so that one can either set a preference or choose to follow what the system does, rather than ecma262 forgetting my preference (if I'll set any) every time the change happens.

@nicolo-ribaudo nicolo-ribaudo Oct 23, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Or, if you want a two-state toggle, following what @LeaVerou suggests on her blog post: https://lea.verou.me/blog/2026/dark-mode-toggles/

Another common mistake is being overzealous about removing the stored value when the system preference changes, even if the user has explicitly set an override.
This evaluation must only happen at user interaction.

(fwiw Lea, I find your analogy with tap faucets to be quite... leaking. The best faucets are the ones with two separate knobs, one for pressure and one for temperature. The worse ones are those with a single one-axis knob that somehow controls both parameters, and that I've only found in American and Japanese hotels).

@michaelficarra

Copy link
Copy Markdown
Member

I would prefer not to have a dedicated button taking up valuable screen real estate for this. We already have the multipage preference configured via the keyboard shortcuts help dialogue. Can this be placed next to it?

This branch has not been deployed

No deployments
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.

Flag to disable dark mode

5 participants