Configure CSS Selectors and Variables in AstroFont
masterThe AstroFont configuration allows you to control how font styles are applied to your document via CSS selectors or variables.
selector: Defines a CSS class or selector (e.g.,.custom_classorbody > span) that will reflect the generated CSS, including fallback font references.cssVariable: Defines a CSS variable name (e.g.,astro-font) that will be injected into the:rootselector. You can then use it in your styles asfont-family: var(--astro-font).
<AstroFont
config={[
{
name: "Afacad",
// ... other config
selector: ".custom_class",
},
{
name: "Inter",
// ... other config
cssVariable: "astro-font",
},
]}
/>