Skip to content

dan-online/nuxt-bunny-fonts

Repository files navigation

Nuxt Bunny Fonts

npm version npm downloads License

Bunny Fonts for Nuxt 3

Check out all the fonts you can use at Bunny Fonts

Features

  • Easily use Bunny Fonts
  • Automatically injects the Bunny Fonts stylesheet
  • Allows for infinite fonts

Quick Setup

  1. Add nuxt-bunny-fonts dependency to your project
# Using yarn
yarn add --dev nuxt-bunny-fonts

# Using pnpm
pnpm add -D nuxt-bunny-fonts

# Using npm
npm install --save-dev nuxt-bunny-fonts
  1. Add nuxt-bunny-fonts to the modules section of nuxt.config.ts
export default defineNuxtConfig({
  modules: [
    'nuxt-bunny-fonts'
  ],
  bunnyFonts: {
    families: {
      Montserrat: [300, 400, 700],
    }
  }
})

That's it! You can now use Nuxt Bunny Fonts in your Nuxt app ✨

Migrate

Migrating from google-fonts to bunny-fonts is easy:

  1. Remove @nuxtjs/google-fonts from your modules section of nuxt.config.ts
  2. Add nuxt-bunny-fonts to your modules section of nuxt.config.ts
  3. Change the googleFonts property to bunnyFonts in your nuxt.config.ts
export default defineNuxtConfig({
  modules: [
-  '@nuxtjs/google-fonts',
+  'nuxt-bunny-fonts'
  ],
- googleFonts: {
+ bunnyFonts: {
    families: {
      Montserrat: [300, 400, 700],
    }
  }
})

Development

# Install dependencies
npm install

# Generate type stubs
npm run dev:prepare

# Develop with the playground
npm run dev

# Build the playground
npm run dev:build

# Run ESLint
npm run lint

# Run Vitest
npm run test
npm run test:watch

# Release new version
npm run release