MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / applyExportPrefs

Function applyExportPrefs

apps/desktop/src/renderer/export-window.tsx:172–207  ·  view source on GitHub ↗
(prefs: ExportPrefs)

Source from the content-addressed store, hash-verified

170}
171
172function applyExportPrefs(prefs: ExportPrefs): void {
173 const html = document.documentElement
174 html.dataset.contentAlign = prefs.contentAlign
175 html.setAttribute('data-opaque', '')
176 applyExportTheme(prefs)
177 html.style.setProperty('--z-editor-font-size', `${prefs.editorFontSize}px`)
178 html.style.setProperty('--z-editor-line-height', String(prefs.editorLineHeight))
179 html.style.setProperty(
180 '--z-preview-max-width',
181 `min(${prefs.previewMaxWidth}px, ${PDF_PRINTABLE_WIDTH})`
182 )
183 html.style.setProperty(
184 '--z-editor-max-width',
185 `min(${prefs.editorMaxWidth}px, ${PDF_PRINTABLE_WIDTH})`
186 )
187
188 const setFont = (name: string, value: string | null, fallback: string): void => {
189 if (value) html.style.setProperty(name, `"${value}", ${fallback}`)
190 else html.style.removeProperty(name)
191 }
192 setFont(
193 '--z-interface-font',
194 prefs.interfaceFont,
195 '-apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, system-ui, sans-serif'
196 )
197 setFont(
198 '--z-text-font',
199 prefs.textFont,
200 '"SF Mono", "SFMono-Regular", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace'
201 )
202 setFont(
203 '--z-mono-font',
204 prefs.monoFont,
205 '"SF Mono", "SFMono-Regular", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace'
206 )
207}
208
209function ExportNoteWindow({ notePath }: { notePath: string }): JSX.Element {
210 const [prefs] = useState(loadExportPrefs)

Callers 1

ExportNoteWindowFunction · 0.70

Calls 2

applyExportThemeFunction · 0.85
setFontFunction · 0.70

Tested by

no test coverage detected