feature: vor und nachteile

This commit is contained in:
Hikyu
2026-05-31 13:54:31 +02:00
parent 552a947a1c
commit e3dad17446
23270 changed files with 3024794 additions and 200 deletions
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021-PRESENT Anthony Fu <https://github.com/antfu>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+11
View File
@@ -0,0 +1,11 @@
# @unocss/preset-web-fonts
Web fonts support for [UnoCSS](https://github.com/unocss/unocss).
## Documentation
Please refer to the [documentation](https://unocss.dev/presets/web-fonts).
## License
MIT License &copy; 2022-PRESENT [Anthony Fu](https://github.com/antfu)
+16
View File
@@ -0,0 +1,16 @@
import * as _unocss_core from '@unocss/core';
import { W as WebFontMeta, a as WebFontsProviders, R as ResolvedWebFontMeta, P as Provider, b as WebFontsOptions } from './shared/preset-web-fonts.TGEYFvVV.mjs';
export { A as Axes, c as WebFontProcessor } from './shared/preset-web-fonts.TGEYFvVV.mjs';
declare function normalizedFontMeta(meta: WebFontMeta | string, defaultProvider: WebFontsProviders): ResolvedWebFontMeta;
declare function createGoogleCompatibleProvider(name: WebFontsProviders, host: string): Provider;
/**
* Preset for using web fonts by provide just the names.
*
* @see https://unocss.dev/presets/web-fonts
*/
declare const presetWebFonts: _unocss_core.PresetFactory<any, WebFontsOptions>;
export { Provider, ResolvedWebFontMeta, WebFontMeta, WebFontsOptions, WebFontsProviders, createGoogleCompatibleProvider as createGoogleProvider, presetWebFonts as default, normalizedFontMeta, presetWebFonts };
+16
View File
@@ -0,0 +1,16 @@
import * as _unocss_core from '@unocss/core';
import { W as WebFontMeta, a as WebFontsProviders, R as ResolvedWebFontMeta, P as Provider, b as WebFontsOptions } from './shared/preset-web-fonts.TGEYFvVV.js';
export { A as Axes, c as WebFontProcessor } from './shared/preset-web-fonts.TGEYFvVV.js';
declare function normalizedFontMeta(meta: WebFontMeta | string, defaultProvider: WebFontsProviders): ResolvedWebFontMeta;
declare function createGoogleCompatibleProvider(name: WebFontsProviders, host: string): Provider;
/**
* Preset for using web fonts by provide just the names.
*
* @see https://unocss.dev/presets/web-fonts
*/
declare const presetWebFonts: _unocss_core.PresetFactory<any, WebFontsOptions>;
export { Provider, ResolvedWebFontMeta, WebFontMeta, WebFontsOptions, WebFontsProviders, createGoogleCompatibleProvider as createGoogleProvider, presetWebFonts as default, normalizedFontMeta, presetWebFonts };
+339
View File
@@ -0,0 +1,339 @@
import { mergeDeep, toArray, definePreset } from '@unocss/core';
const LAYER_IMPORTS = "imports";
function createBunnyFontsProvider(name, host) {
return {
name,
getImportUrl(fonts) {
const fontFamilies = fonts.map((font) => {
const { name: name2, weights, italic } = font;
const formattedName = name2.toLowerCase().replace(/\s/g, "-");
if (!weights?.length)
return `${formattedName}${italic ? ":i" : ""}`;
let weightsAsString = weights.map((weight) => weight.toString());
const weightsHaveItalic = weightsAsString.some((weight) => weight.endsWith("i"));
if (!weightsHaveItalic && italic)
weightsAsString = weightsAsString.map((weight) => weight += "i");
return `${formattedName}:${weightsAsString.join(",")}`;
});
return `${host}/css?family=${fontFamilies.join("|")}&display=swap`;
}
};
}
const BunnyFontsProvider = createBunnyFontsProvider(
"bunny",
"https://fonts.bunny.net"
);
const FontshareProvider = createFontshareProvider("fontshare", "https://api.fontshare.com");
function createFontshareProvider(name, host) {
return {
name,
getImportUrl(fonts) {
const strings = fonts.map((f) => {
let name2 = f.name.replace(/\s+/g, "-").toLocaleLowerCase();
if (f.weights?.length)
name2 += `@${f.weights.flatMap((w) => f.italic ? Number(w) + 1 : w).sort().join()}`;
else name2 += `@${f.italic ? 2 : 1}`;
return `f[]=${name2}`;
}).join("&");
return `${host}/v2/css?${strings}&display=swap`;
}
};
}
function createFontSourceProvider(name, host) {
const fontsMap = /* @__PURE__ */ new Map();
const variablesMap = /* @__PURE__ */ new Map();
return {
name,
async getPreflight(fonts) {
const list = await Promise.all(fonts.map(async (font) => {
const css = [];
const id = font.name.toLowerCase().replace(/\s+/g, "-");
let metadata = fontsMap.get(id);
if (!metadata) {
const url = `https://api.fontsource.org/v1/fonts/${id}`;
try {
metadata = await (await import('ofetch')).$fetch(url);
fontsMap.set(id, metadata);
} catch {
throw new Error(`Failed to fetch font: ${font.name}`);
}
}
const { subsets, weights } = metadata;
if (metadata.variable) {
let variableData = variablesMap.get(id);
const url = `https://api.fontsource.org/v1/variable/${id}`;
try {
variableData = await (await import('ofetch')).$fetch(url);
variablesMap.set(id, variableData);
} catch {
throw new Error(`Failed to fetch font variable: ${font.name}`);
}
const mergeAxes = mergeDeep(variableData.axes, font.variable ?? {});
for (const subset of subsets) {
const url2 = `${host}/fontsource/fonts/${metadata.id}:vf@latest/${subset}-${font.italic ? "wght-italic" : "wght-normal"}.woff2`;
const fontObj = {
family: `${metadata.family}`,
display: "swap",
style: font.italic ? "italic" : "normal",
weight: 400,
src: [{
url: url2,
format: "woff2-variations"
}],
variable: {
wght: mergeAxes.wght ?? void 0,
wdth: mergeAxes.wdth ?? void 0,
slnt: mergeAxes.slnt ?? void 0
},
unicodeRange: metadata.unicodeRange[subset],
comment: `${metadata.id}-${subset}-wght-normal`
};
css.push(generateFontFace(fontObj));
}
} else {
const _weights = font.weights && font.weights.length > 0 ? font.weights : weights;
for (const subset of subsets) {
for (const weight of _weights) {
const url = `${host}/fontsource/fonts/${metadata.id}@latest/${subset}-${weight}-${font.italic ? "italic" : "normal"}`;
const fontObj = {
family: metadata.family,
display: "swap",
style: font.italic ? "italic" : "normal",
weight: Number(weight),
src: [{
url: `${url}.woff2`,
format: "woff2"
}],
unicodeRange: metadata.unicodeRange[subset],
comment: `${metadata.id}-${subset}-${weight}${font.italic ? "-italic" : "-normal"}`
};
css.push(generateFontFace(fontObj));
}
}
}
return css;
}));
return list.flat().join("\n\n");
}
};
}
const FontSourceProvider = createFontSourceProvider("fontsource", "https://cdn.jsdelivr.net");
function generateFontFace(font) {
const {
family,
style,
display,
weight,
variable,
src,
unicodeRange,
comment,
spacer = "\n "
} = font;
const { wght, wdth, slnt } = variable ?? {};
let result = "@font-face {";
result += `${spacer}font-family: '${family}';`;
result += `${spacer}font-style: ${slnt ? `oblique ${Number(slnt.max) * -1}deg ${Number(slnt.min) * -1}deg` : style};`;
result += `${spacer}font-display: ${display};`;
result += `${spacer}font-weight: ${wght ? getVariableWght(wght) : weight};`;
if (wdth)
result += `${spacer}font-stretch: ${wdth.min}% ${wdth.max}%;`;
result += `${spacer}src: ${src.map(({ url, format }) => `url(${url}) format('${format}')`).join(", ")};`;
if (unicodeRange)
result += `${spacer}unicode-range: ${unicodeRange};`;
if (comment)
result = `/* ${comment} */
${result}`;
return `${result}
}`;
}
function getVariableWght(axes) {
if (!axes)
return "400";
if (axes.min === axes.max)
return `${axes.min}`;
return `${axes.min} ${axes.max}`;
}
function createGoogleCompatibleProvider(name, host) {
return {
name,
getImportUrl(fonts) {
const sort = (weights) => {
const firstW = weights.map((w) => w[0]);
const lastW = weights.map((w) => w[1]);
return `${firstW.join(";")};${lastW.join(";")}`;
};
const strings = fonts.map((i) => {
let name2 = i.name.replace(/\s+/g, "+");
if (i.weights?.length) {
name2 += i.italic ? `:ital,wght@${sort(i.weights.map((w) => [`0,${w}`, `1,${w}`]))}` : `:wght@${i.weights.join(";")}`;
}
return `family=${name2}`;
}).join("&");
return `${host}/css2?${strings}&display=swap`;
}
};
}
const GoogleFontsProvider = createGoogleCompatibleProvider("google", "https://fonts.googleapis.com");
const NoneProvider = {
name: "none",
getPreflight() {
return "";
},
getFontName(font) {
return font.name;
}
};
const builtinProviders = {
google: GoogleFontsProvider,
bunny: BunnyFontsProvider,
fontshare: FontshareProvider,
fontsource: FontSourceProvider,
none: NoneProvider
};
function resolveProvider(provider) {
if (typeof provider === "string")
return builtinProviders[provider];
return provider;
}
function normalizedFontMeta(meta, defaultProvider) {
if (typeof meta !== "string") {
meta.provider = resolveProvider(meta.provider || defaultProvider);
if (meta.weights)
meta.weights = [...new Set(meta.weights.sort((a, b) => a.toString().localeCompare(b.toString(), "en", { numeric: true })))];
return meta;
}
const [name, weights = ""] = meta.split(":");
return {
name,
weights: [...new Set(weights.split(/[,;]\s*/).filter(Boolean).sort((a, b) => a.localeCompare(b, "en", { numeric: true })))],
provider: resolveProvider(defaultProvider)
};
}
function createWebFontPreset(fetcher) {
return (options = {}) => {
const {
provider: defaultProvider = "google",
extendTheme = true,
inlineImports = true,
themeKey = "fontFamily",
customFetch = fetcher,
timeouts = {}
} = options;
const processors = toArray(options.processors || []);
const fontObject = Object.fromEntries(
Object.entries(options.fonts || {}).map(([name, meta]) => [name, toArray(meta).map((m) => normalizedFontMeta(m, defaultProvider))])
);
const fonts = Object.values(fontObject).flatMap((i) => i);
const importCache = {};
async function fetchWithTimeout(url) {
if (timeouts === false)
return customFetch(url);
const {
warning = 1e3,
failure = 2e3
} = timeouts;
let warned = false;
const timer = setTimeout(() => {
console.warn(`[unocss] Fetching web fonts: ${url}`);
warned = true;
}, warning);
return await Promise.race([
customFetch(url),
new Promise((_, reject) => {
setTimeout(() => reject(new Error(`[unocss] Fetch web fonts timeout.`)), failure);
})
]).then((res) => {
if (warned)
console.info(`[unocss] Web fonts fetched.`);
return res;
}).finally(() => clearTimeout(timer));
}
async function importUrl(url) {
if (inlineImports) {
if (!importCache[url]) {
importCache[url] = fetchWithTimeout(url).catch((e) => {
console.error(`[unocss] Failed to fetch web fonts: ${url}`);
console.error(e);
if (typeof process !== "undefined" && process.env.CI)
throw e;
});
}
return await importCache[url];
} else {
return `@import url('${url}');`;
}
}
const enabledProviders = Array.from(new Set(fonts.map((i) => i.provider)));
async function getCSSDefault(fonts2, providers) {
const preflights = [];
for (const provider of providers) {
const fontsForProvider = fonts2.filter((i) => i.provider.name === provider.name);
if (provider.getImportUrl) {
const url = provider.getImportUrl(fontsForProvider);
if (url)
preflights.push(await importUrl(url));
}
preflights.push(await provider.getPreflight?.(fontsForProvider));
}
const css = preflights.filter(Boolean).join("\n");
return css;
}
const preset = {
name: "@unocss/preset-web-fonts",
preflights: [
{
async getCSS() {
let css;
for (const processor of processors) {
const result = await processor.getCSS?.(fonts, enabledProviders, getCSSDefault);
if (result) {
css = result;
break;
}
}
if (!css) {
css = await getCSSDefault(
fonts,
enabledProviders
);
}
for (const processor of processors)
css = await processor.transformCSS?.(css) || css;
return css;
},
layer: inlineImports ? void 0 : LAYER_IMPORTS
}
]
};
if (extendTheme) {
preset.extendTheme = (theme) => {
if (!theme[themeKey])
theme[themeKey] = {};
const obj = Object.fromEntries(
Object.entries(fontObject).map(([name, fonts2]) => [name, fonts2.map((f) => f.provider.getFontName?.(f) ?? `"${f.name}"`)])
);
for (const key of Object.keys(obj)) {
if (typeof theme[themeKey][key] === "string")
theme[themeKey][key] = obj[key].map((i) => `${i},`).join("") + theme[themeKey][key];
else
theme[themeKey][key] = obj[key].join(",");
}
};
}
return preset;
};
}
const userAgentWoff2 = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36";
const defaultFetch = async (url) => (await import('ofetch')).$fetch(url, { headers: { "User-Agent": userAgentWoff2 }, retry: 3 });
const presetWebFonts = definePreset(createWebFontPreset(defaultFetch));
export { createGoogleCompatibleProvider as createGoogleProvider, presetWebFonts as default, normalizedFontMeta, presetWebFonts };
+32
View File
@@ -0,0 +1,32 @@
import { c as WebFontProcessor } from './shared/preset-web-fonts.TGEYFvVV.mjs';
import '@unocss/core';
interface LocalFontProcessorOptions {
/**
* Current working directory
*
* @default process.cwd()
*/
cwd?: string;
/**
* Directory to cache the fonts
*
* @default 'node_modules/.cache/unocss/fonts'
*/
cacheDir?: string;
/**
* Directory to save the fonts assets
*
* @default 'public/assets/fonts'
*/
fontAssetsDir?: string;
/**
* Base URL to serve the fonts from the client
*
* @default '/assets/fonts'
*/
fontServeBaseUrl?: string;
}
declare function createLocalFontProcessor(options?: LocalFontProcessorOptions): WebFontProcessor;
export { type LocalFontProcessorOptions, createLocalFontProcessor };
+32
View File
@@ -0,0 +1,32 @@
import { c as WebFontProcessor } from './shared/preset-web-fonts.TGEYFvVV.js';
import '@unocss/core';
interface LocalFontProcessorOptions {
/**
* Current working directory
*
* @default process.cwd()
*/
cwd?: string;
/**
* Directory to cache the fonts
*
* @default 'node_modules/.cache/unocss/fonts'
*/
cacheDir?: string;
/**
* Directory to save the fonts assets
*
* @default 'public/assets/fonts'
*/
fontAssetsDir?: string;
/**
* Base URL to serve the fonts from the client
*
* @default '/assets/fonts'
*/
fontServeBaseUrl?: string;
}
declare function createLocalFontProcessor(options?: LocalFontProcessorOptions): WebFontProcessor;
export { type LocalFontProcessorOptions, createLocalFontProcessor };
+94
View File
@@ -0,0 +1,94 @@
import { Buffer } from 'node:buffer';
import { createHash } from 'node:crypto';
import fs from 'node:fs';
import fsp from 'node:fs/promises';
import { resolve, join } from 'node:path';
import process from 'node:process';
import { fetch } from 'ofetch';
function replaceAsync(string, searchValue, replacer) {
try {
if (typeof replacer === "function") {
const values = [];
String.prototype.replace.call(string, searchValue, (...args) => {
values.push(replacer(...args));
return "";
});
return Promise.all(values).then((resolvedValues) => {
return String.prototype.replace.call(string, searchValue, () => {
return resolvedValues.shift() || "";
});
});
} else {
return Promise.resolve(
String.prototype.replace.call(string, searchValue, replacer)
);
}
} catch (error) {
return Promise.reject(error);
}
}
const fontUrlRegex = /[-\w@:%+.~#?&/=]+\.(?:woff2?|eot|ttf|otf|svg)/gi;
const urlProtocolRegex = /^[\s\w\0+.-]{2,}:([/\\]{1,2})/;
function createLocalFontProcessor(options) {
const cwd = options?.cwd || process.cwd();
const cacheDir = resolve(cwd, options?.cacheDir || "node_modules/.cache/unocss/fonts");
const fontAssetsDir = resolve(cwd, options?.fontAssetsDir || "public/assets/fonts");
const fontServeBaseUrl = options?.fontServeBaseUrl || "/assets/fonts";
async function _downloadFont(url, assetPath) {
const response = await fetch(url).then((r) => r.arrayBuffer());
await fsp.mkdir(fontAssetsDir, { recursive: true });
await fsp.writeFile(assetPath, Buffer.from(response));
}
const cache = /* @__PURE__ */ new Map();
function downloadFont(url, assetPath) {
if (!cache.has(url))
cache.set(url, _downloadFont(url, assetPath));
return cache.get(url);
}
return {
async getCSS(fonts, providers, getCSSDefault) {
const hash = getHash(JSON.stringify(fonts));
const cachePath = join(cacheDir, `${hash}.css`);
if (fs.existsSync(cachePath)) {
return fsp.readFile(cachePath, "utf-8");
}
const css = await getCSSDefault(fonts, providers);
await fsp.mkdir(cacheDir, { recursive: true });
await fsp.writeFile(cachePath, css, "utf-8");
return css;
},
async transformCSS(css) {
return await replaceAsync(css, fontUrlRegex, async (url) => {
const hash = getHash(url);
const ext = url.split(".").pop();
let name = "";
const match1 = url.match(/\/s\/([^/]+)\//);
if (match1)
name = match1[1].replace(/\W/g, " ").trim().replace(/\s+/, "-").toLowerCase();
const filename = `${[name, hash].filter(Boolean).join("-")}.${ext}`;
const assetPath = join(fontAssetsDir, filename);
if (!fs.existsSync(assetPath)) {
const _url = hasProtocol(url) ? url : withProtocol(url);
await downloadFont(_url, assetPath);
}
return `${fontServeBaseUrl}/${filename}`;
});
}
};
}
function getHash(input, length = 8) {
return createHash("sha256").update(input).digest("hex").slice(0, length);
}
function hasProtocol(input) {
return urlProtocolRegex.test(input);
}
function withProtocol(input, protocol = "https://") {
const match = input.match(/^\/{2,}/);
if (!match)
return protocol + input;
return protocol + input.slice(match[0].length);
}
export { createLocalFontProcessor };
@@ -0,0 +1,90 @@
import { Awaitable, Arrayable } from '@unocss/core';
type WebFontsProviders = 'google' | 'bunny' | 'fontshare' | 'fontsource' | 'none' | Provider;
interface WebFontMeta {
name: string;
weights?: (string | number)[];
italic?: boolean;
variable?: Record<string, Partial<Axes>>;
/**
* Override the provider
* @default <matches root config>
*/
provider?: WebFontsProviders;
}
interface WebFontProcessor {
getCSS?: (fonts: ResolvedWebFontMeta[], providers: Provider[], getCSSDefault: (fonts: ResolvedWebFontMeta[], providers: Provider[]) => Awaitable<string>) => Awaitable<string | undefined>;
transformCSS?: (css: string) => Promise<string | undefined>;
}
interface ResolvedWebFontMeta extends Omit<WebFontMeta, 'provider'> {
provider: Provider;
}
interface WebFontsOptions {
/**
* Provider service of the web fonts
* @default 'google'
*/
provider?: WebFontsProviders;
/**
* The fonts
*/
fonts?: Record<string, WebFontMeta | string | (WebFontMeta | string)[]>;
/**
* Extend fonts to the theme object
* @default true
*/
extendTheme?: boolean;
/**
* Key for the theme object
*
* @default 'fontFamily'
*/
themeKey?: string;
/**
* Inline CSS @import()
*
* @default true
*/
inlineImports?: boolean;
/**
* Custom fetch function
*
* @default undefined
*/
customFetch?: (url: string) => Promise<any>;
/**
* Custom processor for the font CSS
*/
processors?: Arrayable<WebFontProcessor>;
/**
* Timeouts for fetching web fonts
*/
timeouts?: false | {
/**
* Timeout for printing warning message
*
* @default 500
*/
warning?: number;
/**
* Timeout for failing the fetch
*
* @default 2000
*/
failure?: number;
};
}
interface Provider {
name: WebFontsProviders;
getPreflight?: (fonts: WebFontMeta[]) => Awaitable<string | undefined>;
getImportUrl?: (fonts: WebFontMeta[]) => string | undefined;
getFontName?: (font: WebFontMeta) => string;
}
interface Axes {
default: string;
min: string;
max: string;
step: string;
}
export type { Axes as A, Provider as P, ResolvedWebFontMeta as R, WebFontMeta as W, WebFontsProviders as a, WebFontsOptions as b, WebFontProcessor as c };
@@ -0,0 +1,90 @@
import { Awaitable, Arrayable } from '@unocss/core';
type WebFontsProviders = 'google' | 'bunny' | 'fontshare' | 'fontsource' | 'none' | Provider;
interface WebFontMeta {
name: string;
weights?: (string | number)[];
italic?: boolean;
variable?: Record<string, Partial<Axes>>;
/**
* Override the provider
* @default <matches root config>
*/
provider?: WebFontsProviders;
}
interface WebFontProcessor {
getCSS?: (fonts: ResolvedWebFontMeta[], providers: Provider[], getCSSDefault: (fonts: ResolvedWebFontMeta[], providers: Provider[]) => Awaitable<string>) => Awaitable<string | undefined>;
transformCSS?: (css: string) => Promise<string | undefined>;
}
interface ResolvedWebFontMeta extends Omit<WebFontMeta, 'provider'> {
provider: Provider;
}
interface WebFontsOptions {
/**
* Provider service of the web fonts
* @default 'google'
*/
provider?: WebFontsProviders;
/**
* The fonts
*/
fonts?: Record<string, WebFontMeta | string | (WebFontMeta | string)[]>;
/**
* Extend fonts to the theme object
* @default true
*/
extendTheme?: boolean;
/**
* Key for the theme object
*
* @default 'fontFamily'
*/
themeKey?: string;
/**
* Inline CSS @import()
*
* @default true
*/
inlineImports?: boolean;
/**
* Custom fetch function
*
* @default undefined
*/
customFetch?: (url: string) => Promise<any>;
/**
* Custom processor for the font CSS
*/
processors?: Arrayable<WebFontProcessor>;
/**
* Timeouts for fetching web fonts
*/
timeouts?: false | {
/**
* Timeout for printing warning message
*
* @default 500
*/
warning?: number;
/**
* Timeout for failing the fetch
*
* @default 2000
*/
failure?: number;
};
}
interface Provider {
name: WebFontsProviders;
getPreflight?: (fonts: WebFontMeta[]) => Awaitable<string | undefined>;
getImportUrl?: (fonts: WebFontMeta[]) => string | undefined;
getFontName?: (font: WebFontMeta) => string;
}
interface Axes {
default: string;
min: string;
max: string;
step: string;
}
export type { Axes as A, Provider as P, ResolvedWebFontMeta as R, WebFontMeta as W, WebFontsProviders as a, WebFontsOptions as b, WebFontProcessor as c };
+60
View File
@@ -0,0 +1,60 @@
{
"name": "@unocss/preset-web-fonts",
"type": "module",
"version": "0.65.4",
"description": "Web Fonts support for Uno CSS",
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
"license": "MIT",
"funding": "https://github.com/sponsors/antfu",
"homepage": "https://github.com/unocss/unocss/tree/main/packages/preset-web-fonts#readme",
"repository": {
"type": "git",
"url": "https://github.com/unocss/unocss",
"directory": "packages/preset-web-fonts"
},
"bugs": {
"url": "https://github.com/unocss/unocss/issues"
},
"keywords": [
"unocss",
"unocss-preset",
"fonts",
"web-fonts",
"google-fonts"
],
"sideEffects": false,
"exports": {
".": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"./local": {
"types": "./dist/local.d.mts",
"default": "./dist/local.mjs"
}
},
"main": "dist/index.mjs",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"typesVersions": {
"*": {
"*": [
"./dist/*",
"./*"
]
}
},
"files": [
"*.css",
"dist"
],
"dependencies": {
"ofetch": "^1.4.1",
"@unocss/core": "0.65.4"
},
"scripts": {
"build": "unbuild",
"stub": "unbuild --stub",
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
}
}