Twin.macro: How to add custom fonts using twin.macro?

Created on 29 Jun 2020  路  3Comments  路  Source: ben-rogerson/twin.macro

I want to replace the default "serif" and "sans" fonts in Tailwindcss with another font. How can go about doing that? I'm using Next.js if it helps.

More specifically, where do I save the downloaded font and configure twin to use it?

Most helpful comment

@rbutera Hey, could you give further explanations on how to do this? I'm using twin.macro with nextjs and styled components. Do I need to change something inside next.config.js? I added the font inside public/fonts but can't get this to work. Already read the Tailwind documentation...

All 3 comments

@rbutera Hey, could you give further explanations on how to do this? I'm using twin.macro with nextjs and styled components. Do I need to change something inside next.config.js? I added the font inside public/fonts but can't get this to work. Already read the Tailwind documentation...

I've used the next-fonts package to load fonts, perhaps take a look at that.

next-fonts / how to setup with styled-components

Was this page helpful?
0 / 5 - 0 ratings

Related issues

owaiswiz picture owaiswiz  路  4Comments

clement-buchart picture clement-buchart  路  5Comments

vincent-vieira picture vincent-vieira  路  7Comments

JoseRFelix picture JoseRFelix  路  4Comments

kieran-osgood picture kieran-osgood  路  5Comments