Skip to content

window.matchMedia('(prefers-color-scheme: dark)') work in Edge when I change the browser appearance color? #303

Closed
@zizxzy

Description

window.matchMedia('(prefers-color-scheme: dark)').addEventListener will work in Edge when I change the browser appearance color,but it does not work in Google Chrome when I change the browser appearance.

code

window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', function () {
    console.log('change')
 })

image

the chrome issue link:https://issues.chromium.org/issues/40642550

Metadata

Assignees

No one assigned

    Labels

    feedbackFeedback about an existing DevTools feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions