Box shadow issue

Hi, I’ve just updated my Anki to anki-2.1.65-windows-qt5, and I’ve noticed that box shadow that I’ve applied in styling doesn’t work anymore.
Here are two screenshots from my previous version and the new version:

1 Like

Hi! By any chance, are you using Anki with Minimalist mode enabled?

1 Like

Oh. Actually yes. That was the first thing I did after the update. Because suddenly everything looked bigger to me. And that seems to be the problem. Thanks.

I see! If you want, by adjusting your CSS, you should be able to have a box-shadow even with Minimalist mode enabled.

The reason why box-shadow doesn’t work is that Anki currently uses this code:

body:not(.fancy), body:not(.fancy) * {
    box-shadow: none !important;
    backdrop-filter: none !important;

Where :not(.fancy) corresponds to Minimalist mode.

By increasing the specificity of your own selector (by prepending body) and using !important, you should be able to override the default styling.

For example, this kind of code seems to work fine on my computer:

body .myClass {
  box-shadow: ... !important;

I’ve logged this on Consider making reduce-motion and minimalist modes opt-in instead of opt-out · Issue #2557 · ankitects/anki · GitHub

1 Like

Tried adding box-shadows to my cards today. Can confirm that it doesn’t work. However, the shadows are visible in the Browser window when editing field contents.

upd: Thanks for the fix!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.