Add .nightMode.card in styling.css

Many people nowadays use dark mode and changing colours isn’t very straightforward for that. Adding a .nightMode.card to styling should alleviate this issue.

I believe this wouldn’t complicate the code too much and on will help people customise their templates.

1 Like

What do you propose to put in it? The different clients have different default background colors in night mode, so we wouldn’t want to specify a background. Also, ‘night-mode’ (kebab case) is the most common CSS class naming style. Anki & AnkiMobile support it - does AnkiDroid?

1 Like

If we put color then at least it would serve as a hint for where to make a change when in night mode.

It does. (Anki manual only mentions .nightMode which is why I use it all the time).

With just color + night-mode, no objections on my end.

1 Like

Does this work though? If the background is different on every platform, then the text color must be different on every platform as well to ensure enough contrast for accessibility.

We could reference CSS variables to solve this; but I think I remember that you (dae) rejected this in the past arguing it would complicate things too much (and thus making it more difficult for beginners to understand and change the css templates).

2 Likes

FYI, sorata opened a PR: