ivodolenc / nuxt-font-loader

Handles your fonts with ease.
MIT License
74 stars 2 forks source link

feat: add new `external` strategy for loading fonts #11

Closed ivodolenc closed 1 year ago

ivodolenc commented 1 year ago

Types of Changes

Additional Details

Request Description

External Strategy

To load fonts directly from third-party servers use external option.

The module will automatically detect servers and preload sources accordingly so you don't have to worry about it.

// nuxt.config.ts

{
  fontLoader: {
    external: [
      {
        src: 'https://fonts.googleapis.com/css2?family=Inter&display=swap',
        family: 'Inter',
        class: 'font-inter' // optional
      }
    ]
  }
}