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

@dmurph Agreed we need something to be clear. I was writing the above on my mobile, so to clarify, what I’m thinking would end up looking something like this:

```json
{
  "name": "My super cool app",
  "theme_color": "#ff9900",
  "background_color": "#ebebeb",
  "user_preferences": [
    {
      "context": "(prefers-color-scheme: dark)",
      "redefine": {
        "theme_color": "#bdbdbd",
        "background_color": "#000000"
      }
    },
  ],
  "translations": {
    "context": "de",
    "redefine": {
      "name": "Meine super coole App"
    }
  }
}
```

I think the "context" (or a similar term) and the block that is being redefined (or that contains overrides) makes a pretty strong mental connection between the two. Again, not necessarily married to the terms, but I think keeping it more broadly applicable will enable us to re-use this pattern in numerous places. Then in each use, we can define what strings are acceptable for the context value and which members can be redefined in the block. For the block name, I think keeping the nomenclature clear about the fact that it is replacing/supplanting/redefining/overriding existing manifest values is key. Options I’d thought about include:

* "redefine" - I like this because it’s active
* "overrides" or "override" - accurate, if a little challenging to spell with the double-r
* "replace" - again, active
* "members" - more spec-language accurate than intuitive

Of the ones you suggested, I think "values" could also work, though it is key/value pairs, so it’s not _entirely_ accurate.

For the context of this feature, I think I’m coming back around to `user_preferences`, especially if we are not looking to support the entirety of Media Query features and are limiting it to user preference MQs specifically (which would be my preference).

-- 
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-866181770

Received on Tuesday, 22 June 2021 17:24:59 UTC