You can use Nuxt Fonts with pure CSS by adding font-family
declarations to your CSS:
div {
font-family: 'Inter', sans-serif;
}
font-family
declaration. Subsequent fonts in the list will be used to generate metrics for font fallbacks.You can use Nuxt Fonts with Tailwind CSS by setting fontFamily
in your configuration file:
export default {
theme: {
extend: {
fontFamily: {
custom: ['Inter'],
},
},
},
}
TailwindCSS v4 brings a brand new way for configuration. In v4 if you want to specify a font, you would use a CSS variable:
@theme {
--font-display: "Inter", "sans-serif";
}
processCSSVariables
to true
for Tailwind v4 support, it is no longer needed or recommended for v0.11.0 and above.You can use Nuxt Fonts with UnoCSS by setting fontFamily
in your configuration file:
import { defineConfig } from 'unocss'
export default defineConfig({
theme: {
fontFamily: {
inter: 'Inter',
},
},
})