correction sans-serif default

This commit is contained in:
Julie Blanc 2026-03-05 19:06:27 +01:00
parent bc2317ab69
commit 89e5fe6612
2 changed files with 4 additions and 3 deletions

View file

@ -481,7 +481,6 @@ input[type=number] {
.settings-subsection { .settings-subsection {
padding: var(--space-xs) 0; padding: var(--space-xs) 0;
padding-left: 30px;
} }
.settings-subsection h3 { .settings-subsection h3 {
margin-top: calc(var(--space-xs) * 1.5); margin-top: calc(var(--space-xs) * 1.5);

View file

@ -88,7 +88,7 @@ const textDefaults = useTextDefaults();
const { fonts: projectFonts, loadFont, loadAllFontPreviews } = useProjectFonts(); const { fonts: projectFonts, loadFont, loadAllFontPreviews } = useProjectFonts();
// State initial values match stylesheet.print.css (overwritten by syncFromStore) // 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 fontSize = ref({ value: 14, unit: 'px' });
const lineHeight = ref({ value: 18, unit: 'px' }); const lineHeight = ref({ value: 18, unit: 'px' });
const color = ref('rgb(0, 0, 0)'); const color = ref('rgb(0, 0, 0)');
@ -141,10 +141,12 @@ const syncFromStore = () => {
color.value = textDefaults.color; color.value = textDefaults.color;
} else { } else {
// First mount read from CSS store // 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'); const fontVal = extractValue('body', 'font-family');
if (fontVal) { if (fontVal) {
const cleaned = fontVal.replace(/['"]/g, '').trim(); 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'); const colorVal = extractValue('body', 'color');