在低光或夜间环境下,暗色主题能显著降低屏幕整体亮度,减少强光对眼睛的刺激。
不过笔记里的图片如果白色亮色比较多,还是会显得比较刺眼。如果图片能稍微暗一点就好了。
偶然看到别人用的 Maple 主题有这个功能,比我想得还要好,鼠标悬停能变亮。
赶紧抄了过来。😼
/*
暗色主题全局图片暗化 + 悬停变亮
强制覆盖(即使图片有内联 style)
*/
/* 暗色主题下全局图片暗化 */
body.theme-dark img,
body.theme-dark img[style] {
filter: brightness(0.7) !important; /* 暗化 */
transition: filter var(--animation, 0.2s ease-in-out) !important;
cursor: pointer !important; /* 鼠标指针 */
}
/* 暗色主题下悬停时变亮 */
body.theme-dark img:hover,
body.theme-dark img[style]:hover {
filter: brightness(0.85) !important;
}

subframe7536/obsidian-theme-maple: A sleek and modern Obsidian theme for desktop and mobile.
Tag: #Obsidian #主题 #CSS #使用心得
文章评论