CSS 夜间模式不会将黑色文本更改为白色(过滤器反转)

发布于 2025-01-20 14:30:03 字数 459 浏览 2 评论 0原文

我正在使用 CSS 来更改 Anki/Ankidroid 上夜间模式的外观。由于我使用了大量的高亮显示,而常规夜间模式仅更改背景和文本。它使带有黄色突出显示的白色文本变得不可读...所以我使用反转过滤器来反转所有颜色,效果非常好,但是黑色文本仍然是黑色且不可读

我的代码是

.night_mode {
 background-color: #000000;
  filter: invert(1);
 
}

.night_mode img {
  filter: invert(1);
}

这是问题的屏幕截图(甚至是红色文本更改为青色,黄色突出显示更改为深蓝色)在此处输入图像描述

I'm using CSS to change the appearance of night mode on Anki/Ankidroid. Since I use lot of highlight and the regular nightmode only change the backround and the text. It makes unreadable a white text with a yellow highlight... So I used the invert filter to invert all the colors and it worked terrific BUT the black text remains black and unreadable

My code is

.night_mode {
 background-color: #000000;
  filter: invert(1);
 
}

.night_mode img {
  filter: invert(1);
}

And here is a screenshot of the problem (even the red text changed to cyan and the yellow highlight to dark blue)enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

撩心不撩汉 2025-01-27 14:30:03

Anki已经具有夜间模式功能,我建议您挂上它,而不是自己上课。您可以阅读更多在这里,但要点是当您进入设置时并设置夜间模式,包含卡的所有内容的标签具有类Nightmode

Anki already has a night mode feature, and I suggest you hook on that instead of making your own classes. You can read more here, but the main point is that when you go in the settings and set night mode, the tag that contains all the content of the card has the class nightMode.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文