reload custom css

This commit is contained in:
Julie Blanc 2026-03-09 15:37:05 +01:00
parent 9c58edb425
commit b544928a65
7 changed files with 115 additions and 39 deletions

View file

@ -14,9 +14,11 @@ import { useKeyboardShortcuts } from './composables/useKeyboardShortcuts';
import { useIframeInteractions } from './composables/useIframeInteractions';
import { usePreviewRenderer } from './composables/usePreviewRenderer';
import { usePrintPreview } from './composables/usePrintPreview';
import { useProjectFonts } from './composables/useProjectFonts';
const stylesheetStore = useStylesheetStore();
const narrativeStore = useNarrativeStore();
const { loadFontsFromCss } = useProjectFonts();
const previewFrame1 = ref(null);
const previewFrame2 = ref(null);
@ -86,6 +88,8 @@ onMounted(async () => {
// Initialize stylesheet with custom CSS
if (narrativeStore.data) {
await stylesheetStore.initializeFromNarrative(narrativeStore.data);
// Pre-load any fonts referenced in the saved CSS so @font-face rules are ready for the preview
await loadFontsFromCss(stylesheetStore.customCss);
}
// Render preview after data is loaded