Font Customization Guide
This guide explains how to change the font in your template. By default, the template uses the Poppins font, but you can easily switch to any font available on Fontsource.
Steps to Change the Font
Follow these steps to change the default font:
1. Choose a Font from Fontsource
- Visit Fontsource.
- Browse or search for a font you want to use.
- Note the package name of the font (e.g.,
@fontsource/roboto
).
2. Install the Font Package
- Open your terminal and navigate to the root of your project.
- Run the following command to install the desired font package:
Replace <font-name>
with the name of your chosen font (e.g., roboto
).
3. Import the Font in Your Code
- Open the
src/layouts/MainLayout.astro
file. - Add/Replace the following import statements at the top of the file:
Replace <font-name>
with your chosen font name. Adjust the weight values (e.g., 400
, 500
) as needed.
4. Update the Tailwind Configuration
- Open the
tailwind.config.js
file. - Update the
fontFamily
property underextend
:
Replace <Font Name>
with the display name of your chosen font (e.g., Roboto
).
Additional Notes
- If the font does not render correctly, clear your browser cache and refresh the page.
- You can mix and match multiple fonts by importing them individually and referencing them in your CSS or Tailwind configuration.
Need Help?
- Join our Telegram support group here.