@unocss/preset-web-fonts 0.44.7 → 0.45.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +6 -2
- package/dist/index.mjs +6 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -54,7 +54,9 @@ const preset = (options = {}) => {
|
|
|
54
54
|
inlineImports = true,
|
|
55
55
|
themeKey = "fontFamily"
|
|
56
56
|
} = options;
|
|
57
|
-
const fontObject = Object.fromEntries(
|
|
57
|
+
const fontObject = Object.fromEntries(
|
|
58
|
+
Object.entries(options.fonts || {}).map(([name, meta]) => [name, core.toArray(meta).map((m) => normalizedFontMeta(m, defaultProvider))])
|
|
59
|
+
);
|
|
58
60
|
const fonts = Object.values(fontObject).flatMap((i) => i);
|
|
59
61
|
const importCache = {};
|
|
60
62
|
async function importUrl(url) {
|
|
@@ -101,7 +103,9 @@ const preset = (options = {}) => {
|
|
|
101
103
|
preset2.extendTheme = (theme) => {
|
|
102
104
|
if (!theme[themeKey])
|
|
103
105
|
theme[themeKey] = {};
|
|
104
|
-
const obj = Object.fromEntries(
|
|
106
|
+
const obj = Object.fromEntries(
|
|
107
|
+
Object.entries(fontObject).map(([name, fonts2]) => [name, fonts2.map((f) => providers[f.provider || defaultProvider].getFontName(f))])
|
|
108
|
+
);
|
|
105
109
|
for (const key of Object.keys(obj)) {
|
|
106
110
|
if (typeof theme[themeKey][key] === "string")
|
|
107
111
|
theme[themeKey][key] = obj[key].map((i) => `${i},`).join("") + theme[themeKey][key];
|
package/dist/index.mjs
CHANGED
|
@@ -50,7 +50,9 @@ const preset = (options = {}) => {
|
|
|
50
50
|
inlineImports = true,
|
|
51
51
|
themeKey = "fontFamily"
|
|
52
52
|
} = options;
|
|
53
|
-
const fontObject = Object.fromEntries(
|
|
53
|
+
const fontObject = Object.fromEntries(
|
|
54
|
+
Object.entries(options.fonts || {}).map(([name, meta]) => [name, toArray(meta).map((m) => normalizedFontMeta(m, defaultProvider))])
|
|
55
|
+
);
|
|
54
56
|
const fonts = Object.values(fontObject).flatMap((i) => i);
|
|
55
57
|
const importCache = {};
|
|
56
58
|
async function importUrl(url) {
|
|
@@ -97,7 +99,9 @@ const preset = (options = {}) => {
|
|
|
97
99
|
preset2.extendTheme = (theme) => {
|
|
98
100
|
if (!theme[themeKey])
|
|
99
101
|
theme[themeKey] = {};
|
|
100
|
-
const obj = Object.fromEntries(
|
|
102
|
+
const obj = Object.fromEntries(
|
|
103
|
+
Object.entries(fontObject).map(([name, fonts2]) => [name, fonts2.map((f) => providers[f.provider || defaultProvider].getFontName(f))])
|
|
104
|
+
);
|
|
101
105
|
for (const key of Object.keys(obj)) {
|
|
102
106
|
if (typeof theme[themeKey][key] === "string")
|
|
103
107
|
theme[themeKey][key] = obj[key].map((i) => `${i},`).join("") + theme[themeKey][key];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-web-fonts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.45.1",
|
|
4
4
|
"description": "Web Fonts support for Uno CSS",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"*.css"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@unocss/core": "0.
|
|
45
|
+
"@unocss/core": "0.45.1",
|
|
46
46
|
"ohmyfetch": "^0.4.18"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|