Re: [w3c/ServiceWorker] Allow service workers to detect light/dark mode (#1577)

> are you suggesting that this is not the right forum to discuss this issue

I think eventually it should be discussed elsewhere, since the details currently sit with CSS. But here is fine until you need thoughts from the CSS folks.

Currently media queries target:

- Things related to the document/window, such as `max-width`, `aspect-ratio`
- Things related to the active screen, such as `color-gamut`, and the deprecated `device-width` stuff
- Things related to the device, such as `prefers-reduced-motion`, `pointer`

A non-window context cannot query document/window properties unless it's linked to a document/window. In dedicated workers, a particular window can be assumed, but in shared/service workers you'd need a particular `Client` to call against.

A non-window context cannot query screen properties unless it's linked to a particular screen, which is possible if the context is linked to a particular document/window/screen, or if screens can be enumerated.

For device-wide properties, it seems reasonable for this to be accessed in a way that isn't dependent on a document/window. However, I might be missing cases where these values can change across tabs.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/1577#issuecomment-815550188

Received on Thursday, 8 April 2021 08:08:44 UTC