Skip to content

Possible to remove !important css tags for nightmode background and text? #258

@ethanwood17

Description

@ethanwood17

Which Note Type (and version) is this about?

AnKingOverhaul, but I think other Anking style cards have this issue as well.

Checklist

Please replace the space inside the brackets with an x if the following items apply:

  • I've verified that I use the latest version of the note type by redownloading it from AnkiWeb
  • I've checked if anyone else asked this question before by looking through the issue reports.
  • I've read through the README documents on this github and/or watched the tutorial video on the note types

What Anki version are you using?

*Please open Anki, go to Help → About (windows) or Anki → About Anki (mac) to find the version. Edit the value between the backticks below

25.09.4

Problem

I am using an add-on which allows me to change the background colors for Anki. I noticed that it works ok in lightmode, but fails which I change Anki over to darkmode. There is a persistent black box over most of the review page. I believe I isolated the issue to the use of !important on a few CSS classes specific to nightmode. See the before and after pictures, as well as the portion of CSS I commented out which ended up fixing the issue.

Before

Image showing card before css change

CSS Change

Image showing css change removing !important

After

Image showing card after css change

Proposed Fix

I wonder if the !important keyword could be removed, which would allow local settings to override the background that is set in the card? I could of course change the card CSS myself on my machine, but I expect other people have or will run into this issue as well when they try to set a custom background color.

If removing !important seems possible, I would be happy to submit a PR.

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions