Socket
Socket
Sign inDemoInstall

@unocss/preset-web-fonts

Package Overview
Dependencies
5
Maintainers
2
Versions
252
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @unocss/preset-web-fonts

Web Fonts support for Uno CSS


Version published
Weekly downloads
251K
decreased by-23.91%
Maintainers
2
Created
Weekly downloads
 

Package description

What is @unocss/preset-web-fonts?

@unocss/preset-web-fonts is a preset for UnoCSS that allows you to easily integrate web fonts into your project. It simplifies the process of adding and managing web fonts by providing a set of utilities and configurations.

What are @unocss/preset-web-fonts's main functionalities?

Basic Font Integration

This feature allows you to easily integrate basic web fonts into your project. You can specify different font families for sans, serif, and mono text.

import { defineConfig } from 'unocss';
import { presetWebFonts } from '@unocss/preset-web-fonts';

export default defineConfig({
  presets: [
    presetWebFonts({
      fonts: {
        sans: 'Roboto',
        serif: 'Merriweather',
        mono: 'Source Code Pro',
      },
    }),
  ],
});

Custom Font Weights and Styles

This feature allows you to specify custom font weights and styles, including italic variants, for your web fonts.

import { defineConfig } from 'unocss';
import { presetWebFonts } from '@unocss/preset-web-fonts';

export default defineConfig({
  presets: [
    presetWebFonts({
      fonts: {
        sans: [
          {
            name: 'Roboto',
            weights: ['400', '700'],
            italic: true,
          },
        ],
      },
    }),
  ],
});

Google Fonts Integration

This feature allows you to easily integrate Google Fonts into your project by specifying the provider as 'google'.

import { defineConfig } from 'unocss';
import { presetWebFonts } from '@unocss/preset-web-fonts';

export default defineConfig({
  presets: [
    presetWebFonts({
      provider: 'google',
      fonts: {
        sans: 'Roboto',
        serif: 'Merriweather',
        mono: 'Source Code Pro',
      },
    }),
  ],
});

Other packages similar to @unocss/preset-web-fonts

Readme

Source

@unocss/preset-web-fonts

Web fonts support for UnoCSS.

Documentation

Please refer to the documentation.

License

MIT License © 2022-PRESENT Anthony Fu

Keywords

FAQs

Last updated on 11 Jun 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc