how to add webfonts to tailwindcss

How To Add Webfonts To Tailwindcss

Step -1 import font in CSS file

 @import url('https://fonts.googleapis.com/css?family=Nunito:400,700&display=swap');

Extending fontFamily in tailwind.config.js

/* In your tailwind.config.js */

module.exports = {
  theme: {
    // Some useful comment
    fontFamily: {
      'nunito': ['nunito', 'sans-serif'],
      'MyFont': ['"My Font"', 'serif'] // Ensure fonts with spaces have " " surrounding it.
    },
  },
  variants: {
    // Some useful comment
  },
  plugins: [
    // Some useful comment
  ]
}