From 58268632c8ebc2855c38305a05b8326727e388c1 Mon Sep 17 00:00:00 2001 From: Luffy <52o@qq52o.cn> Date: Sun, 5 Jan 2025 15:23:17 +0800 Subject: [PATCH] feat: Support dark mode for zoom-image plugin (#2524) --- src/plugins/zoom-image.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/zoom-image.js b/src/plugins/zoom-image.js index 9b74c953e..52e1ebef7 100644 --- a/src/plugins/zoom-image.js +++ b/src/plugins/zoom-image.js @@ -10,13 +10,17 @@ function install(hook) { ), ); + Docsify.dom.style( + `.medium-zoom-image--opened,.medium-zoom-overlay{z-index:999}`, + ); + elms = elms.filter(elm => !elm.matches('a img')); if (zoom) { zoom.detach(); } - zoom = mediumZoom(elms); + zoom = mediumZoom(elms, { background: 'var(--color-bg)' }); }); }