feat: add dark mode image background for mdbook dark themes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
cydia2001
2026-03-10 22:31:14 +00:00
parent a699ae34c1
commit 55bb87884a
2 changed files with 9 additions and 0 deletions

View File

@@ -15,3 +15,4 @@ command = "python3 tools/mdbook_zh_preprocessor.py"
git-repository-url = "https://github.com/openmlsys/openmlsys-zh"
mathjax-support = true
preferred-dark-theme = "navy"
additional-css = ["theme/dark-mode-images.css"]

View File

@@ -0,0 +1,8 @@
/* 暗色模式下为图片添加浅灰色背景,提高透明背景图片的可读性 */
.navy img,
.coal img,
.ayu img {
background-color: #e8e8e8;
border-radius: 4px;
padding: 8px;
}