Devmaurice's avatar

Tailwindcss : Adding custom font family from google font.

How do add font family to tailwindcss ?

 font-family: 'Lato', sans-serif; 
0 likes
2 replies
nhayder's avatar

Tailwind doesn't do anything special to auto-import fonts or anything, so you need to import them the same way you would in a regular project, either by adding the Google stylesheet reference to the top of your HTML like this:

<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">

...or by importing your fonts with @font-face declarations at the beginning of your CSS file:

@font-face {
    
    // here

}

https://github.com/tailwindcss/discuss/issues/177

1 like

Please or to participate in this conversation.