Skip to content

Switch to dark mode automatically via prefers-color-scheme  #236

@rugk

Description

@rugk

You already have a light and dark mode, but they are only to be switched manually.

There is a quite new CSS media query feature called prefers-color-scheme. It allows you to detect whether the system/user wants a dark website, so you can adjust your CSS.

Currently it is only supported by Safari and Firefox 67 or higher.

Anyway, it would be great, if you could make use of this. IMHO just set the default theme to the one the system wants, if the user did not set it manually…

BTW: I also have a Firefox add-on called “Dark Mode Website Switcher” (source code) that you can use to toggle this setting in Firefox directly – without needing to change the system option. Maybe that could be helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions