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
fix(options/appearance): theme defined not previewed correctly
Elian Doranf9b0a88a4ec2
diff --git a/apps/client/src/widgets/type_widgets/options/appearance.tsx b/apps/client/src/widgets/type_widgets/options/appearance.tsxindex 027667de56..04f5477837 100644--- a/apps/client/src/widgets/type_widgets/options/appearance.tsx+++ b/apps/client/src/widgets/type_widgets/options/appearance.tsx@@ -361,11 +361,19 @@ function Font({ label, sizeDescription, fontFamilyOption, fontSizeOption, disabl.find(item => item.value === fontFamily);const displayLabel = currentFont?.label ?? currentFont?.value ?? fontFamily ?? "";+ // Map option name to CSS variable+ const themeCssVariable = {+ mainFontFamily: "var(--main-font-family)",+ treeFontFamily: "var(--tree-font-family)",+ detailFontFamily: "var(--detail-font-family)",+ monospaceFontFamily: "var(--monospace-font-family)"+ }[fontFamilyOption] ?? "inherit";+// Get the CSS font-family value for previewconst getFontFamily = (value: string) => {if (value === "theme") {- // Use inherited font from the current theme- return "inherit";+ // Use the theme's CSS variable for this font option+ return themeCssVariable;}if (value === "system") {// Use the appropriate system font stack