feat(theme): start implementing a theme for TriliumNext

This commit is contained in:
Elian Doran
2024-11-22 20:09:32 +02:00
parent 79b31bda76
commit 7cb9671fe3
4 changed files with 6 additions and 2 deletions

View File

@@ -41,6 +41,7 @@ export default class ThemeOptions extends OptionsWidget {
async optionsLoaded(options) { async optionsLoaded(options) {
const themes = [ const themes = [
{ val: 'next', title: t("theme.triliumnext") },
{ val: 'light', title: t('theme.light_theme') }, { val: 'light', title: t('theme.light_theme') },
{ val: 'dark', title: t('theme.dark_theme') } { val: 'dark', title: t('theme.dark_theme') }
].concat(await server.get('options/user-themes')); ].concat(await server.get('options/user-themes'));

View File

View File

@@ -1061,7 +1061,8 @@
"theme_label": "Theme", "theme_label": "Theme",
"override_theme_fonts_label": "Override theme fonts", "override_theme_fonts_label": "Override theme fonts",
"light_theme": "Light", "light_theme": "Light",
"dark_theme": "Dark" "dark_theme": "Dark",
"triliumnext": "TriliumNext"
}, },
"zoom_factor": { "zoom_factor": {
"title": "Zoom Factor (desktop build only)", "title": "Zoom Factor (desktop build only)",

View File

@@ -54,6 +54,8 @@ function getThemeCssUrl(theme: string) {
return false; // light theme is always loaded as baseline return false; // light theme is always loaded as baseline
} else if (theme === 'dark') { } else if (theme === 'dark') {
return `${assetPath}/stylesheets/theme-dark.css`; return `${assetPath}/stylesheets/theme-dark.css`;
} else if (theme === "next") {
return `${assetPath}/stylesheets/theme-next.css`;
} else { } else {
const themeNote = attributeService.getNoteWithLabel('appTheme', theme); const themeNote = attributeService.getNoteWithLabel('appTheme', theme);