How would I go about adding Inter Font to my tailwind config
For context, I am using an express like backend framework with HTMX and Tailwind,
I have never installed a font for a website before, so how would I go about it?
Once its installed how would I add it to Tailwind?
3 Replies
You can add fonts to tailwind by importing them in your globals.css file, here is an example with the font Crimson Text
Then in your tailwind.config.cjs file you will just add the following lines under theme:
Hope this helps!
Forgot to inlcude that you will also need to add this line for any classes you will use it with
"font-body" tells tailwind to use the font in the tailwind.config.cjs file
ah thx
don't use google fonts, they are terrible for performance. Use fontsource.org. You can install the font locally with npm and serve it from your server a lot more efficiently