Do not override theme if already set

This commit is contained in:
Florine W. Dekker 2022-11-26 14:07:33 +01:00
parent 0be8fc9b97
commit 6c8215bc0c
Signed by: FWDekker
GPG Key ID: D3DCFAA8A4560BE0
2 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@fwdekker/template",
"version": "3.3.9",
"version": "3.3.10",
"description": "The base template for pages on fwdekker.com.",
"author": "Florine W. Dekker",
"license": "MIT",

View File

@ -243,7 +243,8 @@ function footerLink(prefix: string, text: string | null | undefined, url: string
* not a valid value as a parameter for that function, its value is considered `undefined`.
*/
doAfterLoad(() => {
$("html")!.dataset["theme"] = "light";
const html = $("html")!;
if (html.dataset["theme"] == null) html.dataset["theme"] = "light";
const navTarget = $(getMetaProperty("fwd:nav:target"));
if (navTarget != null) {