From 93e50f2cd54ea5afc02d32901b7f79d63af68ea1 Mon Sep 17 00:00:00 2001
From: Max Voss <bruno.m.voss@gmail.com>
Date: Mon, 18 Nov 2024 17:33:20 +0100
Subject: [PATCH] added dark mode plugin, reference to background

---
 _static/panda.css | 6 ++++++
 conf.py           | 1 +
 2 files changed, 7 insertions(+)

diff --git a/_static/panda.css b/_static/panda.css
index 268fd65c..734d15d9 100644
--- a/_static/panda.css
+++ b/_static/panda.css
@@ -111,3 +111,9 @@ body, .wy-body-for-nav {
     border-top: inherit;
     padding: inherit;
 }
+
+@media (prefers-color-scheme: dark) {
+    body, .wy-body-for-nav {
+        background: url("https://www.panda3d.org/wp-content/themes/panda3d/assets/img/elements/background_inverted.jpg") #f9f9f9;
+    }
+}
diff --git a/conf.py b/conf.py
index 9a54ed5c..d76073d1 100644
--- a/conf.py
+++ b/conf.py
@@ -53,6 +53,7 @@
     'sphinx.ext.inheritance_diagram',
     'sphinx.ext.viewcode',
     'sphinx.ext.intersphinx',
+    "sphinx_rtd_dark_mode",
 ]
 
 if build_api_reference: