Skip to content

Build your personal knowledge base with Trilium Notes

feat(spreadsheet): use the default font

Elian Doran8618248d57f8
diff --git a/apps/client/src/widgets/type_widgets/spreadsheet/Spreadsheet.tsx b/apps/client/src/widgets/type_widgets/spreadsheet/Spreadsheet.tsx
index 59822e5260..416e76836c 100644
--- a/apps/client/src/widgets/type_widgets/spreadsheet/Spreadsheet.tsx
+++ b/apps/client/src/widgets/type_widgets/spreadsheet/Spreadsheet.tsx
@@ -8,6 +8,7 @@ import "@univerjs/preset-sheets-filter/lib/index.css";
import "@univerjs/preset-sheets-hyper-link/lib/index.css";
import "@univerjs/preset-sheets-data-validation/lib/index.css";
+import { DEFAULT_STYLES } from '@univerjs/core';
import { UniverSheetsConditionalFormattingPreset } from '@univerjs/preset-sheets-conditional-formatting';
import UniverPresetSheetsConditionalFormattingEnUS from '@univerjs/preset-sheets-conditional-formatting/locales/en-US';
import { UniverSheetsCorePreset } from '@univerjs/preset-sheets-core';
@@ -122,6 +123,12 @@ function useInitializeSpreadsheet(containerRef: MutableRef<HTMLDivElement | null
useEffect(() => {
if (!containerRef.current) return;
+ // Override Univer's hardcoded default font to match Trilium's UI font.
+ const ff = getComputedStyle(document.documentElement).getPropertyValue("--detail-font-family").trim();
+ if (ff) {
+ DEFAULT_STYLES.ff = ff;
+ }
+
const { univerAPI } = createUniver({
locale: LocaleType.EN_US,
locales: {