Anki-Night-Mode icon indicating copy to clipboard operation
Anki-Night-Mode copied to clipboard

Apply color swappings to colors defined in template styling

Open salmivas opened this issue 7 years ago • 5 comments

Hello.

I'm trying to change a color on my card but nothing happens (color doesn't change). For example: image

I set colors by using css-styles. image

I've restarted Anki and even my laptop a couple of times but nothing changed. What I do wrong and how can I fix it. Is it a bug?

salmivas avatar Oct 21 '18 10:10 salmivas

Thank you for getting in touch. Please show HTML code of your card. You can do that my pressing ctrl + shift + x on the field of choice, or by selecting "Edit HTML" form hamburger menu on the right.

On Sun, 21 Oct 2018 at 11:47, Ivan Salmin [email protected] wrote:

Hello.

I'm trying to change a color on my card but nothing happens (color doesn't change). For example: [image: image] https://user-images.githubusercontent.com/35002517/47265823-ace24a00-d53e-11e8-9cff-4a7b2884d57c.png

I set colors by using css-styles. [image: image] https://user-images.githubusercontent.com/35002517/47265851-1c583980-d53f-11e8-8d49-26d94384bdb4.png

I've restarted Anki and even my laptop a couple of times but nothing changed. What I do wrong and how can I fix it. Is it a bug?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/krassowski/Anki-Night-Mode/issues/52, or mute the thread https://github.com/notifications/unsubscribe-auth/AFkAxjq_KuwpgxqhVFk97axG6WVtAdMjks5unFCpgaJpZM4XyZJf .

-- Best regards, Michał Krassowski

krassowski avatar Oct 21 '18 10:10 krassowski

Thank you for your quick reply. My card: image

Code of field "№": image

field "IMG": image

field "English": image

field "Keyword": image

field "Transcription": image

field "Russian": image

field "Sound": image

field "BrTranscription": image

field "AmTranscription": image

field "Am&BrTranscription": image

field "Extra": no code

field "Help": no code

salmivas avatar Oct 21 '18 11:10 salmivas

Thanks @salmivas. The color swapping feature was intended to modify colors introduced into the cards in the editor by clicking on "change text color" button. There is no easy technique to modify colors as defined by CSS styles without resorting to JS tricks. I will think about introducing such functionality into the add-on, however you can already accomplish desired result, simply adding a new CSS rule into styling of your template:

.night_mode .halfwidth {
    background: #b36b00
}

Please, see the picture below for reference: screenshot from 2018-10-21 14-08-55

krassowski avatar Oct 21 '18 13:10 krassowski

It works perfectly! Thanks so much @krassowski! Looking forward for the addon.

salmivas avatar Oct 21 '18 13:10 salmivas

This doesn't work at all with the .card class. What if I want to change the background color of an entire card?

daviddavo avatar Sep 09 '19 11:09 daviddavo