0.0.1 • Published 2 years ago
nuxt-fonts v0.0.1
nuxt-fonts
Fonts module for Nuxt
Setup
- Add
nuxt-fontsdependency to your project
With pnpm
pnpm add nuxt-fontsOr, with yarn
yarn add nuxt-fontsOr, with npm
npm install nuxt-fonts- Add
nuxt-fontsto themodulessection ofnuxt.config.ts
export default defineNuxtConfig({
modules: [
// Simple usage
"nuxt-fonts",
// With options
[
"nuxt-fonts",
{
/* module options */
},
],
],
});Using top level options
export default defineNuxtConfig({
modules: ["nuxt-fonts"],
fonts: {
/* module options */
},
});Options
inline
- Type:
Boolean - Default:
nuxt.options.ssr
provider
- Type:
google|local|bunny - Default:
'google'
families
- Type:
Array
export default {
fonts: {
families: [
name: string
as?: string
provider?: Providers
subsets?: string | string[]
display?: FontDisplay
normal?: number | number[] | string | string[]
italic?: number | number[] | string | string[]
fallbacks?: string[]
text?: string
]
}
}fallbacks
- Type:
String[] - Default:
['BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Helvetica Neue', 'Arial', 'Noto Sans']
Contributing
You can contribute to this module online with CodeSandBox:
Or locally:
- Clone this repository
- Install dependencies using
pnpm install - Prepare development server using
pnpm dev:prepare - Build module using
pnpm build - Launch playground using
pnpm dev
License
Copyright (c) Nuxt
0.0.1
2 years ago