···22 PublicationThemeProvider,
23} from "./PublicationThemeProvider";
24import { getColorDifference } from "./themeUtils";
25-import { getFontConfig, getGoogleFontsUrl, getFontFamilyValue, generateFontFaceCSS } from "src/fonts";
2627// define a function to set an Aria Color to a CSS Variable in RGB
28function setCSSVariableToColor(
···186 const bodyFontConfig = getFontConfig(bodyFontId);
187 const headingFontValue = getFontFamilyValue(headingFontConfig);
188 const bodyFontValue = getFontFamilyValue(bodyFontConfig);
0189 const headingGoogleFontsUrl = getGoogleFontsUrl(headingFontConfig);
190 const bodyGoogleFontsUrl = getGoogleFontsUrl(bodyFontConfig);
191···313 "--page-width-units": `min(${pageWidth || 624}px, calc(100vw - 12px))`,
314 "--theme-heading-font": headingFontValue,
315 "--theme-font": bodyFontValue,
0316 } as CSSProperties
317 }
318 >
···22 PublicationThemeProvider,
23} from "./PublicationThemeProvider";
24import { getColorDifference } from "./themeUtils";
25+import { getFontConfig, getGoogleFontsUrl, getFontFamilyValue, generateFontFaceCSS, getFontBaseSize } from "src/fonts";
2627// define a function to set an Aria Color to a CSS Variable in RGB
28function setCSSVariableToColor(
···186 const bodyFontConfig = getFontConfig(bodyFontId);
187 const headingFontValue = getFontFamilyValue(headingFontConfig);
188 const bodyFontValue = getFontFamilyValue(bodyFontConfig);
189+ const bodyFontBaseSize = getFontBaseSize(bodyFontConfig);
190 const headingGoogleFontsUrl = getGoogleFontsUrl(headingFontConfig);
191 const bodyGoogleFontsUrl = getGoogleFontsUrl(bodyFontConfig);
192···314 "--page-width-units": `min(${pageWidth || 624}px, calc(100vw - 12px))`,
315 "--theme-heading-font": headingFontValue,
316 "--theme-font": bodyFontValue,
317+ "--theme-font-base-size": `${bodyFontBaseSize}px`,
318 } as CSSProperties
319 }
320 >
+6
src/fonts.ts
···113};
114115export const defaultFontId = "quattro";
0116117// Parse a Google Fonts URL or string to extract the font name and family parameter
118// Supports various formats:
···235export function getGoogleFontsUrl(font: FontConfig): string | null {
236 if (font.type !== "google") return null;
237 return `https://fonts.googleapis.com/css2?family=${font.googleFontsFamily}&display=swap`;
00000238}
239240// Get the CSS font-family value with fallbacks
···113};
114115export const defaultFontId = "quattro";
116+export const defaultBaseSize = 16;
117118// Parse a Google Fonts URL or string to extract the font name and family parameter
119// Supports various formats:
···236export function getGoogleFontsUrl(font: FontConfig): string | null {
237 if (font.type !== "google") return null;
238 return `https://fonts.googleapis.com/css2?family=${font.googleFontsFamily}&display=swap`;
239+}
240+241+// Get the base font size for a font config
242+export function getFontBaseSize(font: FontConfig): number {
243+ return font.baseSize ?? defaultBaseSize;
244}
245246// Get the CSS font-family value with fallbacks