CSS 夜间模式不会将黑色文本更改为白色(过滤器反转)
我正在使用 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)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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
.