Compare commits

..

2 commits

Author SHA1 Message Date
Julie Blanc
449f0eda31 defaults values from panel 2026-03-05 16:51:35 +01:00
Julie Blanc
ace75a3fb2 repair font-family module 2026-03-05 16:32:19 +01:00
2 changed files with 24 additions and 8 deletions

View file

@ -692,6 +692,26 @@ watch(fontFamily, async (val) => {
if (val && val !== 'sans-serif') await loadFont(val);
});
// Sync disabled special groups with TextSettings defaults
watch(() => textDefaults.fontFamily, (val) => {
if (!settingEnabled.font) fontFamily.value = val;
});
watch(() => textDefaults.fontSize, (val) => {
if (!settingEnabled.fontSize) {
fontSize.value = val.value;
fontSize.unit = val.unit;
}
}, { deep: true });
watch(() => textDefaults.lineHeight, (val) => {
if (!settingEnabled.lineHeight) {
lineHeight.value = val.value;
lineHeight.unit = val.unit;
}
}, { deep: true });
watch(() => textDefaults.color, (val) => {
if (!settingEnabled.color) color.value = val;
});
// Watchers simple props (with group guard)
for (const prop of styleProps) {
watch(prop.get, () => {

View file

@ -138,14 +138,10 @@ export function usePreviewRenderer({
}
);
// Watch for font-face CSS changes (new font loaded) and re-render
watch(
() => stylesheetStore.fontFaceCss,
() => {
if (!initialized.value) return;
renderPreview();
}
);
// Note: no separate watcher on fontFaceCss — the content watcher handles re-render.
// fontFaceCss is read from the store at render time in the srcdoc template.
// loadFont() is awaited before updateStyle() in callers, so fontFaceCss is always
// up to date when the content watcher fires.
// Re-render when narrative data changes
watch(