From 2e275e3993a957ddafac21c8fdc0ff5b092d42d8 Mon Sep 17 00:00:00 2001
From: Starbeamrainbowlabs <sbrl@starbeamrainbowlabs.com>
Date: Wed, 11 Jan 2023 03:26:49 +0000
Subject: [PATCH] docs: initial pass at a dark theme some of the colours still
 suck though

---
 .docs/css/gallerybox.css      |  14 ++++++++++++--
 .docs/css/theme.css           |  24 ++++++++++++++++++++++--
 .docs/images/clouds-night.png | Bin 0 -> 35139 bytes
 3 files changed, 34 insertions(+), 4 deletions(-)
 create mode 100644 .docs/images/clouds-night.png

diff --git a/.docs/css/gallerybox.css b/.docs/css/gallerybox.css
index 7294bfb..bd4d764 100644
--- a/.docs/css/gallerybox.css
+++ b/.docs/css/gallerybox.css
@@ -10,7 +10,17 @@ be (slightly) less hacky once :target-within lands in browsers.
 
 Exported to codepen: https://codepen.io/sbrl/details/YzZJYxg
  */
- 
+
+:root {
+	--gallerybox-bg: hsla(0, 0%, 95%, 0.75);
+}
+
+@media (prefers-color-scheme: dark) {
+	:root {
+		--gallerybox-bg: hsla(0, 0%, 30%, 0.75);
+	}
+}
+
 @media (orientation: landscape) {
 	.gallerybox-gallery {
 		max-width: 95vw;
@@ -58,7 +68,7 @@ Exported to codepen: https://codepen.io/sbrl/details/YzZJYxg
 }
 
 .gallerybox-item > figcaption {
-	background: hsla(0, 0%, 95%, 0.75);
+	background: var(--gallerybox-bg);
 	position: absolute;
 	bottom: 0.25em; left: 0; right: 0;
 	padding: 0.75em 1em;
diff --git a/.docs/css/theme.css b/.docs/css/theme.css
index 01a98e6..1beaecc 100644
--- a/.docs/css/theme.css
+++ b/.docs/css/theme.css
@@ -32,6 +32,27 @@
 	--shadow-dark: hsla(0, 0%, 25%, 0.5);
 	
 	--highlight: hsl(353, 100%, 36%);
+	
+	--bg-image: url('{% image_urlpass "images/clouds.png" %}');
+}
+
+@media (prefers-color-scheme: dark) {
+	:root {
+		--bg-main: #020B18;
+		--bg-bright: hsl(108, 46%, 34%);
+		--bg-alt: hsl(228, 68%, 68%);
+		
+		--bg-transcluscent: hsla(224, 20%, 16%, 0.85);
+		--bg-transcluscent-alt: hsla(226, 79%, 70%, 0.8);
+		
+		--text-main: hsl(227, 80%, 95%);
+		
+		--bg-image: url('{% image_urlpass "images/clouds-night.png" %}');
+	}
+	
+	a { color: #7c7cff; }
+	a:active { color: #ee0000; }
+	a:not(.nav):not(.bigbutton):visited { color: hsl(296, 84%, 75%); }
 }
 
 /* rem is relative to the html element, and em is relative to the current element. */
@@ -42,7 +63,7 @@ body
 	margin: 0;
 	font-family: sans-serif; /* Serif is awful :( */
 	
-	background: url('{% image_urlpass "images/clouds.png" %}') center / cover fixed,
+	background: var(--bg-image) center / cover fixed,
 		var(--bg-main); /* Don't forget to update the @page one too for paged media */
 	color: var(--text-main);
 }
@@ -156,7 +177,6 @@ a { font-weight: bold; }
 a:not(.nav):hover { color: hsl(214, 67%, 50%); }
 a:not(.nav):active, a:focus { color: hsl(214, 87%, 60%); } */
 a:not(.nav):not(.bigbutton):visited { color: hsl(240, 77%, 60%); }
-
 pre {
 	page-break-inside: avoid;
 	break-inside: avoid;
diff --git a/.docs/images/clouds-night.png b/.docs/images/clouds-night.png
new file mode 100644
index 0000000000000000000000000000000000000000..da3d4cc4bde30ef539d9ba79c8c162231951e4b8
GIT binary patch
