Skip to content

[Feature Request] system theme aware detector hints, for github "sync with system" #15929

Open

Description

@pvinis

Prerequisites

Is this feature request related to a problem?

Yes

Feature Request Description

i have github set to "sync with system" and my os is dark, so github renders its own dark theme. dark reader still applies its theme on top, with "detect dark theme" on.

the hint for github.com is:

TARGET
html

MATCH
[data-color-mode="dark"]

github only sets data-color-mode="dark" when you pick "single theme". with "sync with system" it stays auto, and the real theme comes from data-light-theme / data-dark-theme depending on prefers-color-scheme. so the selector never matches and dark reader keeps theming an already dark page.

i know this has history:

so a plain auto match is definitely wrong. but the case is still broken, and i dont think it can be fixed in the config alone, because Element.matches cant see prefers-color-scheme. the condition that is actually true is:

[data-color-mode="auto"] and (prefers-color-scheme: dark) and [data-dark-theme^="dark"]
or
[data-color-mode="auto"] and (prefers-color-scheme: light) and [data-light-theme^="dark"]

both branches are needed, because "sync with system" lets you pick any of the 12 themes per branch, so you can have a dark theme selected for the light branch. @Myshor confirmed that in #15187.

the existing SYSTEM THEME command doesnt cover it either, since it short circuits before MATCH and assumes the site always follows the system, which github doesnt when you use single theme.

what id like to do is add MATCH SYSTEM DARK and MATCH SYSTEM LIGHT to detector-hints, which add their selectors only when prefers-color-scheme matches, and use them for github. same idea as #15187, but only that, nothing else. about 25 lines across detector.ts, the generator, definitions, the config and the config test.

i have it written and the unit tests pass. happy to open the pr, or drop it if you'd rather not add new hint commands.

Screenshots

No response

Additional Context

dark reader 4.9.129, macos dark mode, github appearance set to "sync with system".

Activity

  1. Myshor commented on Aug 26, 2026

    @Myshor
    Collaborator

    Moving review and discussion to PR #15930.

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