From 179923826fcf3af16a24e9d72e53e777cfbd8220 Mon Sep 17 00:00:00 2001 From: Dmitry Kolosov Date: Fri, 18 Feb 2022 14:40:24 +0300 Subject: [PATCH] Remove flash for dark theme on loading #139 --- layouts/partials/head.html | 17 ++++ layouts/partials/theme-switcher.html | 114 +++++++++++++++------------ 2 files changed, 80 insertions(+), 51 deletions(-) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index e62029c..4d5ff18 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -16,6 +16,23 @@ {{ end -}} {{ partial "favicons.html" . }} + + + + + {{ partial "resource.html" (dict "context" . "type" "css" "filename" "css/main.css") }} {{ if .Site.Params.copyCodeButton | default true }} diff --git a/layouts/partials/theme-switcher.html b/layouts/partials/theme-switcher.html index 6ee5cef..f3eff3c 100644 --- a/layouts/partials/theme-switcher.html +++ b/layouts/partials/theme-switcher.html @@ -7,67 +7,79 @@ +{{ end }} - -{{ end }} \ No newline at end of file + changeButtonText() +} + +function showContent() { + document.body.style.visibility = 'visible'; + document.body.style.opacity = 1; +} + \ No newline at end of file