Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@unocss/preset-web-fonts

Package Overview
Dependencies
Maintainers
2
Versions
273
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@unocss/preset-web-fonts

Web Fonts support for Uno CSS

  • 0.61.7
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created

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

Keywords

FAQs

Package last updated on 29 Jul 2024

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc