Re: [w3c/manifest] Add support for defining a theme color for both light & dark modes (prefers color scheme) (#975)

I could live with this, @aarongustafson.

Just for clarity, are you pursuing your [`ImageResource` proposal](https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/ImageResource-color_scheme/explainer.md) in parallel?

It would work well with **`"icons"`** to exclusively focus on the proposal in this Issue (and not pursue the `ImageResource` proposal):

```json
{
 "name": "My super cool app",
 "theme_color": "#ff9900",
 "background_color": "#ebebeb",
 "icons": [{
  "src": "light.png",
  "type": "image/png",
  "sizes": "512x512"
 }],
 "user_preferences": [{
  "context": "(prefers-color-scheme: dark)",
  "redefine": {
   "theme_color": "#bdbdbd",
   "background_color": "#000000",
   "icons": [{
    "src": "light.png",
    "type": "image/png",
    "sizes": "512x512"
   }]
  }
 }],
 "translations": [{
  "context": "de",
  "redefine": {
   "name": "Meine super coole App"
  }
 }]
}
```

But we again have a problem with the **`"shortcuts"`** member. The only way to avoid duplication would be to rely on **array order** in `"shortcuts"`. The example below shows how this could look like with just one shortcut, but it gets messier when there are more shortcuts:

```json
{
 "name": "My super cool app",
 "theme_color": "#ff9900",
 "background_color": "#ebebeb",
 "shortcuts": [{
  "name": "Play",
  "short_name": "Play",
  "description": "Play the list of podcasts",
  "url": "/play?utm_source=homescreen",
  "icons": [{
   "src": "/icons/play-light.png",
   "sizes": "192x192"
  }]
 }],
 "icons": [{
  "src": "light.png",
  "type": "image/png",
  "sizes": "512x512"
 }],
 "user_preferences": [{
  "context": "(prefers-color-scheme: dark)",
  "redefine": {
   "theme_color": "#bdbdbd",
   "background_color": "#000000",
   "icons": [{
    "src": "light.png",
    "type": "image/png",
    "sizes": "512x512"
   }],
   "shortcuts": [{
    "icons": [{
     "src": "/icons/play-dark.png",
     "sizes": "192x192"
    }]
   }]
  }
 }],
 "translations": [{
  "context": "de",
  "redefine": {
   "name": "Meine super coole App",
   "shortcuts": [{
    "name": "Abspielen",
    "short_name": "Abspielen",
    "description": "Spiel die Podcast-Liste",
    "url": "/play?utm_source=homescreen&lang=de"
   }]
  }
 }]
}
```



-- 
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/975#issuecomment-867512145

Received on Thursday, 24 June 2021 10:07:09 UTC