
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
Magical plug-and-play font optimization for modern web applications
@font-face declarations# npm
npm install fontless
# pnpm
pnpm install fontless
Add the fontless plugin to your Vite configuration:
// vite.config.js / vite.config.ts
import { defineConfig } from 'vite'
import { fontless } from 'fontless'
export default defineConfig({
plugins: [
// ... other plugins
fontless()
],
})
Simply use fonts in your CSS as you normally would, and fontless will handle optimization:
/* Your CSS */
.google-font {
font-family: "Poppins", sans-serif;
}
.bunny-font {
font-family: "Aclonica", sans-serif;
}
You can customize fontless with various options:
fontless({
// Configure available providers
providers: {
google: true, // Google Fonts
bunny: true, // Bunny Fonts
fontshare: true, // FontShare
fontsource: true, // FontSource
// Disable a provider
adobe: false
},
// Provider priority order
priority: ['google', 'bunny', 'fontshare'],
// Default font settings
defaults: {
preload: true,
weights: [400, 700],
styles: ['normal', 'italic'],
fallbacks: {
'sans-serif': ['Arial', 'Helvetica Neue']
}
},
// Custom font family configurations
families: [
// Configure a specific font
{
name: 'Poppins',
provider: 'google',
weights: [300, 400, 600]
},
// Manual font configuration
{
name: 'CustomFont',
src: [{ url: '/fonts/custom-font.woff2', format: 'woff2' }],
weight: [400]
}
],
// Asset configuration
assets: {
prefix: '/_fonts'
},
// Experimental features
experimental: {
disableLocalFallbacks: false
}
})
Fontless works by:
@font-face declarations with proper metricscorepack enablepnpm installpnpm devMade with ❤️
Published under MIT License.
FAQs
Magical plug-and-play font optimization for modern web applications
We found that fontless demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
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.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.