mirror of
https://github.com/fruworg/themu.git
synced 2025-06-13 18:20:25 +03:00
Add dark mode toggle
This commit is contained in:
@ -39,9 +39,9 @@
|
||||
{{ $style := resources.Get "css/main.css" | fingerprint }}
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="{{ $style.Permalink }}" />
|
||||
|
||||
{{- if or (eq .Site.Params.mode "auto") (eq .Site.Params.mode "dark") -}}
|
||||
{{- if or (eq .Site.Params.mode "auto") (eq .Site.Params.mode "dark") (eq .Site.Params.mode "toggle") -}}
|
||||
{{ $darkstyle := resources.Get "css/dark.css" | fingerprint }}
|
||||
<link rel="stylesheet" type="text/css" href="{{ $darkstyle.Permalink }}" {{ if eq .Site.Params.mode "auto" }}media="(prefers-color-scheme: dark)"{{ end }} />
|
||||
<link id="darkModeStyle" rel="stylesheet" type="text/css" href="{{ $darkstyle.Permalink }}" {{ if eq .Site.Params.mode "auto" }}media="(prefers-color-scheme: dark)"{{ end }} {{ if eq .Site.Params.mode "toggle" }}disabled{{ end }} />
|
||||
{{ end }}
|
||||
|
||||
<!-- Custom CSS style get applied last -->
|
||||
|
Reference in New Issue
Block a user