Novice Pokémon Master

    astro-fonts-next
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.1 • Public • Published

    astro-fonts-next

    npm downloads License Node.js CI GitHub Repo stars

    This integration applies Next.js font optimization solution to Astro. reference: https://nextjs.org/docs/basic-features/font-optimization

    Installation

    yarn add -D astro-fonts-next

    Usage

    // astro.config.mjs
    import { defineConfig } from 'astro/config'
    import astroFonts from 'astro-fonts-next'
    
    export default defineConfig({
      integrations: [
        astroFonts({ url: 'https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap' }),
        // astroFonts({ url: 'https://use.typekit.net/~~~~~.css' }),
        // or
        astroFonts({
          url: [
            'https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap',
            'https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap',
          ],
        }),
      ],
      experimental: {
        integrations: true,
      },
    })

    API Reference

    Integration

    import astroFonts from 'astro-fonts-next'

    key type required default description
    url string | string[] true The actual link to the font provider to be used. You may specify more than one in the array.
    (e.g.
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
    https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap)

    License

    astro-fonts-next is available under the MIT License.

    Install

    npm i astro-fonts-next

    DownloadsWeekly Downloads

    30

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    50.8 kB

    Total Files

    13

    Last publish

    Collaborators

    • dc7290