add font settings (but font family doesn't work)

This commit is contained in:
Julian Freeman
2025-12-01 08:13:27 -04:00
parent 813229aae9
commit c7c7b5fc4b
6 changed files with 203 additions and 3 deletions

View File

@@ -0,0 +1,27 @@
import { defineStore } from 'pinia';
import { ref, watch } from 'vue';
export const useSettingsStore = defineStore('settings', () => {
// Initialize from localStorage or defaults
const editorFontSize = ref<number>(
Number(localStorage.getItem('editorFontSize')) || 14
);
const editorFontFamily = ref<string>(
localStorage.getItem('editorFontFamily') || 'Fira Code, Consolas, monospace'
);
// Watchers for persistence
watch(editorFontSize, (val) => {
localStorage.setItem('editorFontSize', val.toString());
});
watch(editorFontFamily, (val) => {
localStorage.setItem('editorFontFamily', val);
});
return {
editorFontSize,
editorFontFamily,
};
});