reload custom css
This commit is contained in:
parent
9c58edb425
commit
b544928a65
7 changed files with 115 additions and 39 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue