Bug 1859350 Comment 10 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Masatoshi Kimura [:emk] from comment #6)
> Why `--newtab-background-color` is not aware of color scheme?

It looks like it's theme-aware, rather than color-scheme aware.

That variable is set in chrome://activity-stream/content/css/activity-stream.css which has platform-specific versions, e.g. here's the linux one with the default and then `[lwt-newtab-brighttext]` (i.e. dark-mode) color values:
```
https://searchfox.org/mozilla-central/rev/e94bcd536a2a4caad0597d1b2d624342e6a389c4/browser/components/newtab/css/activity-stream-linux.css#36-37,66-67
```
:root {
  --newtab-background-color: #F9F9FB;
...
:root[lwt-newtab-brighttext] {
  --newtab-background-color: #2B2A33;
```

So: to get a dark background, we're dependent on the `[lwt-newtab-brighttext]` attribute being set on the root, and I guess that happens asynchronously and we can sometimes get a paint before it happens?
(In reply to Masatoshi Kimura [:emk] from comment #6)
> Why `--newtab-background-color` is not aware of color scheme?

It looks like it's theme-aware, rather than color-scheme aware.

That variable is set in chrome://activity-stream/content/css/activity-stream.css which has platform-specific versions, e.g. here's the linux one with the default and then `[lwt-newtab-brighttext]` (i.e. dark-mode) color values:
https://searchfox.org/mozilla-central/rev/e94bcd536a2a4caad0597d1b2d624342e6a389c4/browser/components/newtab/css/activity-stream-linux.css#36-37,66-67
```
:root {
  --newtab-background-color: #F9F9FB;
...
:root[lwt-newtab-brighttext] {
  --newtab-background-color: #2B2A33;
```

So: to get a dark background, we're dependent on the `[lwt-newtab-brighttext]` attribute being set on the root, and I guess that happens asynchronously and we can sometimes get a paint before it happens?
(In reply to Masatoshi Kimura [:emk] from comment #6)
> Why `--newtab-background-color` is not aware of color scheme?

It looks like it's theme-aware, rather than color-scheme aware.

That variable is set in chrome://activity-stream/content/css/activity-stream.css which has platform-specific versions, e.g. here's the linux one with the default and then `[lwt-newtab-brighttext]` (i.e. dark-mode) color values:
https://searchfox.org/mozilla-central/rev/e94bcd536a2a4caad0597d1b2d624342e6a389c4/browser/components/newtab/css/activity-stream-linux.css#36-37,66-67
```css
:root {
  --newtab-background-color: #F9F9FB;
...
:root[lwt-newtab-brighttext] {
  --newtab-background-color: #2B2A33;
```

So: to get a dark background, we're dependent on the `[lwt-newtab-brighttext]` attribute being set on the root, and I guess that happens asynchronously and we can sometimes get a paint before it happens?

Back to Bug 1859350 Comment 10