Skip to content

Implement auto dark mode in CSS #2440

Closed
@atjn

Description

@atjn

Problem

Currently, the page will load with a default light style, then JS will take over and if it detects that it is in "auto theme" mode and that the browser is in dark mode, it replaces the light colors with dark colors. This causes a few problems:

  • If the internet connection is slow, the page will display the light colors first, destroying the dark mode user's eyes.
  • If the user has JS disabled or if it breaks in any way, they will never be able to have dark mode support.

Proposed Solution

You can use CSS media queries to perform the dark mode check inside the CSS.

Notes

Related: #1504

Metadata

Metadata

Assignees

Labels

A-StyleArea: Style (CSS, etc.)A-ThemeArea: ThemeC-enhancementCategory: Enhancement or feature request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions