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