feat(v3): add global font controls to SettingsTab

Add font family select (9 monospace fonts) and font size +/- stepper
(8-24px) to SettingsTab global settings. Both controls apply live
preview via CSS custom properties (--ui-font-family, --ui-font-size)
and persist to SQLite. Restructure global settings from inline rows
to 2-column grid with labels above controls. initTheme() now restores
saved font settings on startup.
This commit is contained in:
Hibryda 2026-03-07 23:02:55 +01:00
parent 1279981bf9
commit 47492aa637
4 changed files with 184 additions and 29 deletions

View file

@ -78,4 +78,20 @@ export async function initTheme(): Promise<void> {
if (currentTheme !== 'mocha') {
applyCssVariables(currentTheme);
}
// Apply saved font settings
try {
const [fontFamily, fontSize] = await Promise.all([
getSetting('font_family'),
getSetting('font_size'),
]);
if (fontFamily) {
document.documentElement.style.setProperty('--ui-font-family', `'${fontFamily}', monospace`);
}
if (fontSize) {
document.documentElement.style.setProperty('--ui-font-size', `${fontSize}px`);
}
} catch {
// Font settings are optional — defaults from catppuccin.css apply
}
}