Corpointa manages available font families through a central config file atDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/EricMartinez758/corpointa-frontend/llms.txt
Use this file to discover all available pages before exploring further.
src/config/fonts.ts. The font a user selects in Settings β Appearance is applied instantly by toggling a CSS class on the <html> element, and the choice is stored in the font cookie so it is restored on every page load. Adding a new font to the application is a three-step process requiring changes to one config file, one HTML file, and one CSS file β no rebuild of Tailwind config is needed.
Font Configuration
The source of truth for all available fonts issrc/config/fonts.ts:
src/config/fonts.ts
fonts array is a const tuple, which means TypeScript derives a union type from it. The AppearanceForm and FontProvider both import this array directly, so adding a new entry here is the only change needed to the config layer.
Default Font
The default font is Public Sans β the first entry in thefonts array. When no font cookie is present (e.g., a first-time visitor), FontProvider falls back to fonts[0], which applies the font-public-sans CSS class. The font family itself is declared in theme.css:
src/styles/theme.css
body element in index.css also carries font-public-sans as its base class to ensure a consistent fallback even before the provider mounts.
How Font Switching Works
When a user changes their font in Settings β Appearance and clicks Update preferences, the following happens:setFont()fromFontProvideris called with the selected font name- The new value is written to the
fontcookie (1-year expiry) - A
useEffectinFontProviderstrips all existingfont-*classes fromdocument.documentElementand adds the new one (e.g.,font-manrope) - Because the Tailwind font utility is scoped to
html, all text in the application immediately re-renders in the new typeface
FontProvider reads the font cookie during its useState initializer and starts with the saved font β the class is applied before the component tree renders, preventing any flash of the default font.
Adding a New Font
Add the font name to the config array
Open
src/config/fonts.ts and append your fontβs slug to the fonts array. Use lowercase and hyphens (matching the Tailwind class convention):src/config/fonts.ts
Load the font file
Add a
<link> preconnect and stylesheet tag to index.html for Google Fonts, or import a local font file:index.html