
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
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 enable
pnpm install
pnpm dev
Made with ❤️
Published under MIT License.
FAQs
Magical plug-and-play font optimization for modern web applications
The npm package fontless receives a total of 282 weekly downloads. As such, fontless popularity was classified as not popular.
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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.