Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add new external strategy for loading fonts #11

Merged
merged 1 commit into from
Nov 28, 2022

Conversation

ivodolenc
Copy link
Owner

Types of Changes

  • New feature 🚀
  • Documentation 📖

Additional Details

  • Updates documentation
  • Improves types and examples
  • Adds new fontLoader.logs option to manage all terminal logs
  • Adds new local.fallback & external.fallback options to define the font family fallback.

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
      }
    ]
  }
}

@ivodolenc ivodolenc added the feat New feature. label Nov 28, 2022
@ivodolenc ivodolenc merged commit 2f3ec21 into main Nov 28, 2022
@ivodolenc ivodolenc deleted the feat/external-strategy branch November 28, 2022 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant