Fix theme to dark and hide the theme switch in the share template
This commit is contained in:
@@ -69,13 +69,11 @@
|
||||
const openGraphDomain = subRoot.note.getLabelValue("shareOpenGraphDomain");
|
||||
%>
|
||||
<title><%= pageTitle %></title>
|
||||
<style>#site-header .theme-selection{display:none}</style>
|
||||
<% if (pageUrl) { %><link rel="canonical" href="<%= pageUrl %>"><% } %>
|
||||
<script>
|
||||
// Load dark/light theme as soon as possible to avoid color flashes.
|
||||
let theme = localStorage.getItem("theme");
|
||||
if (!theme) {
|
||||
theme = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? "dark" : "light";
|
||||
}
|
||||
// Theme is fixed to dark – light/dark switching is disabled.
|
||||
const theme = "dark";
|
||||
document.documentElement.classList.add(`theme-${theme}`);
|
||||
|
||||
window.glob = {
|
||||
|
||||
Reference in New Issue
Block a user