diff options
Diffstat (limited to 'themes/CodeIT/layouts/_default/baseof.html')
-rw-r--r-- | themes/CodeIT/layouts/_default/baseof.html | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/themes/CodeIT/layouts/_default/baseof.html b/themes/CodeIT/layouts/_default/baseof.html index 4303015..804bb28 100644 --- a/themes/CodeIT/layouts/_default/baseof.html +++ b/themes/CodeIT/layouts/_default/baseof.html @@ -18,7 +18,8 @@ <body header-desktop="{{ .Site.Params.header.desktopMode }}" header-mobile="{{ .Site.Params.header.mobileMode }}"> {{- /* Check theme isDark before body rendering */ -}} {{- $theme := .Site.Params.defaulttheme -}} - <script type="text/javascript">(window.localStorage && localStorage.getItem('theme') ? localStorage.getItem('theme') === 'dark' : ('{{ $theme }}' === 'auto' ? window.matchMedia('(prefers-color-scheme: dark)').matches : '{{ $theme }}' === 'dark')) && document.body.setAttribute('theme', 'dark');</script> + {{- $cookieConsentEnabled := .Site.Params.cookieconsent.enable -}} + <script type="text/javascript">('{{ $cookieConsentEnabled }}' === 'true' && window.localStorage && localStorage.getItem('theme') ? localStorage.getItem('theme') === 'dark' : ('{{ $theme }}' === 'auto' ? window.matchMedia('(prefers-color-scheme: dark)').matches : '{{ $theme }}' === 'dark')) && document.body.setAttribute('theme', 'dark');</script> <div id="mask"></div> |