Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(share): drop the theme button from the mobile header
Elian Doranf04e5979c390
diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Sharing.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Sharing.htmlindex eed3ff39ea..b0822c565b 100644--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Sharing.html+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Sharing.html@@ -11,9 +11,8 @@ class="image"><li>Searching by note title.</li><li>Light and dark mode, following the visitor's system setting by default,also while the page is open. The visitor can pick <em>Light</em>, <em>Dark</em> or <em>System</em> with- the buttons at the top of the navigation pane, or on narrow screens with- the button in the header, which cycles through the three; the choice is- remembered by the browser.</li>+ the buttons at the top of the navigation pane; the choice is remembered+ by the browser.</li><li>A layout centered on wide screens, with the navigation tree and the tableof contents at either side of the content, and a mobile-friendly layouton narrow ones. There, the navigation tree slides in from the menu buttondiff --git a/docs/User Guide/User Guide/Advanced Usage/Sharing.md b/docs/User Guide/User Guide/Advanced Usage/Sharing.mdindex 67ff8b99f0..c000af014a 100644--- a/docs/User Guide/User Guide/Advanced Usage/Sharing.md+++ b/docs/User Guide/User Guide/Advanced Usage/Sharing.md@@ -6,7 +6,7 @@ Trilium allows you to share selected notes as **publicly accessible** read-only## Features, interaction and limitations* Searching by note title.-* Light and dark mode, following the visitor's system setting by default, also while the page is open. The visitor can pick _Light_, _Dark_ or _System_ with the buttons at the top of the navigation pane, or on narrow screens with the button in the header, which cycles through the three; the choice is remembered by the browser.+* Light and dark mode, following the visitor's system setting by default, also while the page is open. The visitor can pick _Light_, _Dark_ or _System_ with the buttons at the top of the navigation pane; the choice is remembered by the browser.* A layout centered on wide screens, with the navigation tree and the table of contents at either side of the content, and a mobile-friendly layout on narrow ones. There, the navigation tree slides in from the menu button in the header, and lists the headings of the current page below its entry (at the top of the pane, for a page the tree does not show).* Collapsible tree with the same note icons as the application. It keeps the sections the visitor expanded and its scroll position while they move between the pages of the site, and shows the current note.* Customizable logo.diff --git a/packages/share-theme/src/page/header.css b/packages/share-theme/src/page/header.cssindex 4ff27d59fe..064b5aeba6 100644--- a/packages/share-theme/src/page/header.css+++ b/packages/share-theme/src/page/header.css@@ -91,7 +91,7 @@ html {width: 32px;}-#header > :last-child {+#header > :nth-child(3) {justify-self: end;}diff --git a/packages/share-theme/src/page/theme_switch.ts b/packages/share-theme/src/page/theme_switch.tsindex e6634ebb80..262ec67f74 100644--- a/packages/share-theme/src/page/theme_switch.ts+++ b/packages/share-theme/src/page/theme_switch.ts@@ -2,17 +2,21 @@ import "./theme_switch.css";type ThemePreference = "light" | "dark" | "system";-/** The order of the buttons, and the order in which the header button cycles. */+/**+ * The order of the buttons, and the order in which the header button of older templates cycles+ * through them.+ */const PREFERENCES: ThemePreference[] = [ "light", "dark", "system" ];const STORAGE_KEY = "theme";const themeRootEl = document.documentElement;/**- * Wires the theme buttons of the left pane and the header button, which cycles through the same- * choices. `boot_script.ejs` applies the theme and its `theme-preference-*` class before the first- * paint, and the controls are styled from that class, so this only syncs `aria-pressed`, switches- * the theme on click and follows the system theme while the preference is "system".+ * Wires the theme buttons of the left pane, and the header button of custom templates copied from+ * an earlier `page.ejs`, which cycles through the same choices. `boot_script.ejs` applies the+ * theme and its `theme-preference-*` class before the first paint, and the controls are styled+ * from that class, so this only syncs `aria-pressed`, switches the theme on click and follows the+ * system theme while the preference is "system".*/export default function setupThemeSelector() {const systemDark = window.matchMedia("(prefers-color-scheme: dark)");diff --git a/packages/share-theme/src/templates/page.ejs b/packages/share-theme/src/templates/page.ejsindex 068ae97e56..ce3d274674 100644--- a/packages/share-theme/src/templates/page.ejs+++ b/packages/share-theme/src/templates/page.ejs@@ -33,13 +33,6 @@<div id="header"><button aria-label="<%= t("share_theme.toggle-navigation") %>" id="left-pane-toggle-button" class="header-button"><span class="tn-icon bx bx-menu" aria-hidden="true"></span></button><%- include("site_logo", { id: "header-logo" }) %>- <div class="header-actions">- <button type="button" id="theme-cycle-button" class="header-button">- <span class="theme-cycle-option" data-theme="light" title="<%= t("share_theme.theme-light") %>"><span class="tn-icon bx bx-sun" aria-hidden="true"></span><span class="visually-hidden"><%= t("share_theme.theme-current", { theme: t("share_theme.theme-light") }) %></span></span>- <span class="theme-cycle-option" data-theme="dark" title="<%= t("share_theme.theme-dark") %>"><span class="tn-icon bx bx-moon" aria-hidden="true"></span><span class="visually-hidden"><%= t("share_theme.theme-current", { theme: t("share_theme.theme-dark") }) %></span></span>- <span class="theme-cycle-option" data-theme="system" title="<%= t("share_theme.theme-system") %>"><span class="tn-icon bx bx-desktop" aria-hidden="true"></span><span class="visually-hidden"><%= t("share_theme.theme-current", { theme: t("share_theme.theme-system") }) %></span></span>- </button>- </div></div><div id="split-pane"><div id="left-pane">