From 088be03f0b85dfba8464f12544a96007465e1b02 Mon Sep 17 00:00:00 2001 From: Jan Kremer <79042825+janurskremer@users.noreply.github.com> Date: Fri, 19 Jan 2024 20:02:44 +0100 Subject: [PATCH] :lipstick: Fix Safari status bar style Add status bar style meta tag in head.html, add setting same value in appearance.js --- assets/js/appearance.js | 4 ++++ layouts/partials/head.html | 1 + 2 files changed, 5 insertions(+) diff --git a/assets/js/appearance.js b/assets/js/appearance.js index dd5ad69d..cbbf28f7 100644 --- a/assets/js/appearance.js +++ b/assets/js/appearance.js @@ -8,9 +8,13 @@ function getCSSValue(varName) { function setThemeColor() { var metaThemeColor = document.querySelector("meta[name=theme-color]"); + var metaAppleMobileWebAppStatusBarStyle = document.querySelector("meta[name=apple-mobile-web-app-status-bar-style]"); document.documentElement.classList.contains("dark") ? metaThemeColor.setAttribute("content", getCSSValue("--color-neutral-800")) : metaThemeColor.setAttribute("content", getCSSValue("--color-neutral")); + document.documentElement.classList.contains("dark") + ? metaAppleMobileWebAppStatusBarStyle.setAttribute("content", getCSSValue("--color-neutral-800")) + : metaAppleMobileWebAppStatusBarStyle.setAttribute("content", getCSSValue("--color-neutral")); return true; } diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 2d096767..77b32455 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -2,6 +2,7 @@ + {{/* Title */}} {{ if .IsHome -}} {{ .Site.Title | emojify }}