From 0f73a5840fd11317e45193d4c07fcfc764d56b82 Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Wed, 19 Nov 2025 19:53:19 -0500 Subject: [PATCH] Default background color in mermaid diagrams in dark mode --- yardang/custom.css | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/yardang/custom.css b/yardang/custom.css index 87e9476..3ec8bfd 100644 --- a/yardang/custom.css +++ b/yardang/custom.css @@ -44,3 +44,22 @@ body[data-theme="dark"] .logo-dark { display: none; } } + + +/* Handle mermaid diagrams in dark mode */ +body[data-theme="light"] div.mermaid-container { + background-color: unset; +} +body[data-theme="dark"] div.mermaid-container { + background-color: whitesmoke; +} +@media (prefers-color-scheme: dark) { + div.mermaid-container { + background-color: whitesmoke; + } +} +@media (prefers-color-scheme: light) { + div.mermaid-container { + background-color: unset; + } +}