about summary refs log tree commit diff
path: root/src/librustdoc/html/static/rustdoc.css
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-08-21 17:31:38 +0200
committerGitHub <noreply@github.com>2019-08-21 17:31:38 +0200
commitd034ccabe455fc10e227c7fa7c060f6ecbd53856 (patch)
tree5b81935e84835a1e4f2e0f26951e3bb4c47dcb79 /src/librustdoc/html/static/rustdoc.css
parent7b0085a613e69cb69fc9e4eb5d422fa4a39d5de1 (diff)
parent1bd94241b756bda09c6e079f806c25440a3b2c81 (diff)
downloadrust-d034ccabe455fc10e227c7fa7c060f6ecbd53856.tar.gz
rust-d034ccabe455fc10e227c7fa7c060f6ecbd53856.zip
Rollup merge of #61236 - GuillaumeGomez:system-theme, r=Mark-Simulacrum
take into account the system theme

Fixes #61079.

The CSS can now take into account the system theme. I used it to generate some content on the document and from there, if no theme has already been selected, it'll look at the system level theme.

r? @QuietMisdreavus
cc @fenhl
Diffstat (limited to 'src/librustdoc/html/static/rustdoc.css')
-rw-r--r--src/librustdoc/html/static/rustdoc.css15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css
index 59d10668f11..244b24af43f 100644
--- a/src/librustdoc/html/static/rustdoc.css
+++ b/src/librustdoc/html/static/rustdoc.css
@@ -54,6 +54,21 @@
 		  box-sizing: border-box;
 }
 
+/* This part handles the "default" theme being used depending on the system one. */
+html {
+	content: "";
+}
+@media (prefers-color-scheme: light) {
+	html {
+		content: "light";
+	}
+}
+@media (prefers-color-scheme: dark) {
+	html {
+		content: "dark";
+	}
+}
+
 /* General structure and fonts */
 
 body {