···2222 PublicationThemeProvider,
2323} from "./PublicationThemeProvider";
2424import { getColorDifference } from "./themeUtils";
2525-import { getFontConfig, getGoogleFontsUrl, getFontFamilyValue, generateFontFaceCSS } from "src/fonts";
2525+import { getFontConfig, getGoogleFontsUrl, getFontFamilyValue, generateFontFaceCSS, getFontBaseSize } from "src/fonts";
26262727// define a function to set an Aria Color to a CSS Variable in RGB
2828function setCSSVariableToColor(
···186186 const bodyFontConfig = getFontConfig(bodyFontId);
187187 const headingFontValue = getFontFamilyValue(headingFontConfig);
188188 const bodyFontValue = getFontFamilyValue(bodyFontConfig);
189189+ const bodyFontBaseSize = getFontBaseSize(bodyFontConfig);
189190 const headingGoogleFontsUrl = getGoogleFontsUrl(headingFontConfig);
190191 const bodyGoogleFontsUrl = getGoogleFontsUrl(bodyFontConfig);
191192···313314 "--page-width-units": `min(${pageWidth || 624}px, calc(100vw - 12px))`,
314315 "--theme-heading-font": headingFontValue,
315316 "--theme-font": bodyFontValue,
317317+ "--theme-font-base-size": `${bodyFontBaseSize}px`,
316318 } as CSSProperties
317319 }
318320 >
+6
src/fonts.ts
···113113};
114114115115export const defaultFontId = "quattro";
116116+export const defaultBaseSize = 16;
116117117118// Parse a Google Fonts URL or string to extract the font name and family parameter
118119// Supports various formats:
···235236export function getGoogleFontsUrl(font: FontConfig): string | null {
236237 if (font.type !== "google") return null;
237238 return `https://fonts.googleapis.com/css2?family=${font.googleFontsFamily}&display=swap`;
239239+}
240240+241241+// Get the base font size for a font config
242242+export function getFontBaseSize(font: FontConfig): number {
243243+ return font.baseSize ?? defaultBaseSize;
238244}
239245240246// Get the CSS font-family value with fallbacks