diff --git a/public/assets/css/style.css b/public/assets/css/style.css index a042ac7..6435e6e 100644 --- a/public/assets/css/style.css +++ b/public/assets/css/style.css @@ -481,7 +481,6 @@ input[type=number] { .settings-subsection { padding: var(--space-xs) 0; - padding-left: 30px; } .settings-subsection h3 { margin-top: calc(var(--space-xs) * 1.5); diff --git a/src/components/editor/TextSettings.vue b/src/components/editor/TextSettings.vue index 06c26b2..5048bde 100644 --- a/src/components/editor/TextSettings.vue +++ b/src/components/editor/TextSettings.vue @@ -88,7 +88,7 @@ const textDefaults = useTextDefaults(); const { fonts: projectFonts, loadFont, loadAllFontPreviews } = useProjectFonts(); // State — initial values match stylesheet.print.css (overwritten by syncFromStore) -const font = ref('DM Sans'); +const font = ref('sans-serif'); const fontSize = ref({ value: 14, unit: 'px' }); const lineHeight = ref({ value: 18, unit: 'px' }); const color = ref('rgb(0, 0, 0)'); @@ -141,10 +141,12 @@ const syncFromStore = () => { color.value = textDefaults.color; } else { // First mount — read from CSS store + // For font-family, only accept known project fonts (ignore baseCss fonts like "DM Sans") const fontVal = extractValue('body', 'font-family'); if (fontVal) { const cleaned = fontVal.replace(/['"]/g, '').trim(); - font.value = cleaned || 'sans-serif'; + const isKnownFont = cleaned === 'sans-serif' || projectFonts.some(f => f.name === cleaned); + font.value = isKnownFont ? cleaned : 'sans-serif'; } const colorVal = extractValue('body', 'color');