summaryrefslogtreecommitdiffstats
path: root/layouts
diff options
context:
space:
mode:
authoramzrk22020-06-16 16:29:16 +0800
committeramzrk22020-06-16 16:29:16 +0800
commitbcd4d3fdb1b5e6a6ede2dbc4ea64fc47642a2173 (patch)
treeda3e34c7e03af9993d247d5ac001906cabf6117b /layouts
parentf88c7b78f224bf746b831001ec8cef01693a4b3c (diff)
downloadhugo-theme-fuji-bcd4d3fdb1b5e6a6ede2dbc4ea64fc47642a2173.tar.gz
hugo-theme-fuji-bcd4d3fdb1b5e6a6ede2dbc4ea64fc47642a2173.tar.bz2
hugo-theme-fuji-bcd4d3fdb1b5e6a6ede2dbc4ea64fc47642a2173.zip
Option darken image
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/head.html1
-rw-r--r--layouts/partials/styles.html13
2 files changed, 14 insertions, 0 deletions
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