fix: apply editor font to document preview

This commit is contained in:
林剑凛 authored and GitHub committed 2026-06-17 17:39:38 +08:00
1 parent 45f16cfa2e
commit 9bc19cf3b0
3 files changed
+38 -2

No files matched your search

@@ -0,0 +1,11 @@
import { EDITOR_FONT_FAMILY_CSS_VAR, EDITOR_FONT_SIZE_CSS_VAR } from "@/lib/editorThemes";
import type { EditorSettings } from "@/stores/settingsStore";
export type DocumentViewerFontSettings = Pick<EditorSettings, "fontFamily" | "fontSize">;
export function documentViewerFontStyle(settings: DocumentViewerFontSettings): Record<string, string> {
return {
[EDITOR_FONT_FAMILY_CSS_VAR]: settings.fontFamily,
[EDITOR_FONT_SIZE_CSS_VAR]: `${settings.fontSize}px`,
};
}