From bcd4d3fdb1b5e6a6ede2dbc4ea64fc47642a2173 Mon Sep 17 00:00:00 2001
From: amzrk2
Date: Tue, 16 Jun 2020 16:29:16 +0800
Subject: Option darken image

---
 layouts/partials/head.html   |  1 +
 layouts/partials/styles.html | 13 +++++++++++++
 2 files changed, 14 insertions(+)
 create mode 100644 layouts/partials/styles.html

(limited to 'layouts/partials')

diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 88d3d19..1bcdf85 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -29,6 +29,7 @@
 {{ template "_internal/opengraph.html" . }}
 {{ template "_internal/twitter_cards.html" . }}
 <!-- dep -->
+{{ partial "styles.html" . }}
 {{ if .Site.Params.useHugoPipes }}
 {{ $options := (dict "targetPath" "assets/css/fuji-custom.min.css" "outputStyle" "compressed") }}
 {{ $style := resources.Get "scss/fuji.scss" | resources.ToCSS $options }}
diff --git a/layouts/partials/styles.html b/layouts/partials/styles.html
new file mode 100644
index 0000000..cc6d930
--- /dev/null
+++ b/layouts/partials/styles.html
@@ -0,0 +1,13 @@
+{{ if ne .Site.Params.disableDarkImage true }}
+<style>
+    @media (prefers-color-scheme: dark) {
+        body[data-theme='auto'] img {
+            filter: brightness(60%);
+        }
+    }
+
+    body[data-theme='dark'] img {
+        filter: brightness(60%);
+    }
+</style>
+{{ end }}
\ No newline at end of file
-- 
cgit v1.2.3