Shirajuki / anki-redesign

Anki redesign - a new lightweight look for Anki
https://ankiweb.net/shared/info/308574457
64 stars 4 forks source link

Background-Color #21

Closed Covre912 closed 2 years ago

Covre912 commented 2 years ago

For some reason, the "background-color" doesn't change :(

I've tested without the addon and it works fine.

Here's my card's style:

.card {
 font-family: myfont1; 
 font-size: 25px;
 text-align: center;
 color: black;
 background-color: #FFFAF0;
}

img {
 font-family: Arial;
 width: auto;
 height: auto;
 max-width: 600px;
 max-height: 300px;
 box-shadow: 0 1px 4px 1px rgba(0, 0, 0, 0.2);
}

@font-face {
  font-family: myfont1;
  src: url("_msuigothic.ttf");
}

@font-face {
  font-family: myfont2;
  src: url("_meiryo.ttf");
}

.word {
 font-size: 50px;
 font-family: myfont2; 
}

.glossary {
 font-size: 28px;
}

.reading {
 font-size: 42px;
 font-family: myfont2; 
}

#hint {
 background: #FFFAF0; 
 border: color: black; }

#hint.hidden:hover { background: #FFFAF0; color: #000; cursor: pointer; }
#hint.hidden .payload { display: none; }

#hint.shown { background: #FFFAF0; color: #000; }

#hint.shown .trigger { display: none; }
#hint.shown .payload { display: block; }

And here's the image of the card in practice:

image

Shirajuki commented 2 years ago

Hello again @Kitsune912!

Again, thank you very much for using and helping with the development of Anki-redesign! From the looks of it, it seems the css property background-color of specifically the selector .card is being overwritten by both Anki's own css (if on nightmode) and Anki-redesign's custom css (both light and night mode) due to the css selector's hierarchical. This means that I can issue out a fix for all user's using lightmode easily by just removing my overwrite, but it'll still affect other user's using nightmode since it seems that Anki does overwrite it as well.

A temporary fix for this can be by adding !important after the value of background-color: ie. background-color: #FFFAF0 !important;. To prioritize your css stylings. I'll however try to weight and see if there's another possibility of fixing this without adding a performance latency to the add-on meanwhile.

I'll update you on my findings another day!

Covre912 commented 2 years ago

It worked!

Thx a lot :)