Re: [w3c/manifest] Honor media attribute (#955)

@marcoscaceres wrote:

> No sure I follow. Can you help me understand how they are affected? It would seem color_scheme should only really apply to a particular image resource.

I was saying that those two keys are the only color references (currently) in the manifest spec. Those are the areas that would need to be adjustable to meet the use case as the referenced `ImageResource`s should be able to handle this in a few ways:

* SVG - can adapt via their own media queries
* Bitmapped icons could be swapped on the server side
* `ImageResource` will (hopefully)  become `color_scheme` adaptable

So what I am saying, in a nutshell, is that the surface we’d need to make adaptive is fairly small. In terms of how to solve this, I’m not sure, but a simple proposal might be something like:

```json
"color_schemes": {
  "dark": {
    "theme_color": "#fff",
    "background_color": "#000"
  },
  "light": {
    "theme_color": "#000",
    "background_color": "#fff"
  }
}
```

where the `color_schemes`  member supports named objects that map directly to [CSS’s supported keywords for `prefers-color-scheme`](https://drafts.csswg.org/mediaqueries-5/#descdef-media-prefers-color-scheme) and [it’s eventual evolution to account for high contrast color modes](https://drafts.csswg.org/css-color-adjust-1/#color-scheme-prop). That way we take the dependency on CSS and can hand the colors off to the browser to make the decision (and don’t have to come up with or maintain our own logic). I’m not wedded to this idea, just throwing it out as a possibility.

Note: I would see this sitting alongside the existing `theme_color` & `background_color` members just like `display_override`.

@tomayac said:

> We can just have both…

Agreed. I’m not averse to offering alternative approaches, I’m just wary of forcing devs to go down a path that could eventually become a manageability problem. If we can come up with a solution that allows them to manage it in one place, I think we should. I feel the same way about translations.

-- 
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/manifest/issues/955#issuecomment-786852869

Received on Friday, 26 February 2021 19:37:57 UTC