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

@mgiuca @marcoscaceres @hober @frivoal @tomayac, et al. I truly appreciate all the back-and-forth here. I can definitely understand Matt’s reluctance toward wanting to ship a CSS parser with a Manifest parser, but at the same time I want to make sure we are being at least a little forward-looking in consideration of any solution in this area. To my mind, we need to be able to support two things:

1. dark/light modes (current problem)
2. other user-preferences (future problems)

If we solve for one without solving for the other, I think we’re going to regret the decision.

As most of y’all have said, I don’t relish the thought of creating some new micro-syntax, but we also need a way to directly connect what authors put in their Manifest to what they—or their team members—are doing in their CSS. To that end, it _might_ be possible to do that using a `color_overrides` object if we allowed it to be keyed with any valid MQ "prefers-" suffix key combined with its value, all of which would be derived from the MQ spec. So, for example

```json
"color_overrides": {
  "color-scheme-dark": {
    "theme_color": "#fff",
    "background_color": "#000"
  },
  "color-scheme-light": {
    "theme_color": "#000",
    "background_color": "#fff"
  },
  "contrast-more": {
    "theme_color": "#000",
    "background_color": "#fff"
  }
}
```

Browsers (or OSes) could ignore the ones they don’t understand (as per usual) and we have a clearly-defined path forward for enabling other user preferences down the line. This would allow us to avoid the CSS parser dependency without wholly jettisoning the connection between the two features.

Other key options like `media_overrides` or `preference_overrides` might make more sense than `color_overrides` if we want to allow folks to redefine icons and such too.

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

Received on Tuesday, 8 June 2021 21:05:55 UTC