@pubinfo/config 2.0.0-beta.31 → 2.0.0-beta.32
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/eslint/index.d.ts +2 -6
- package/dist/eslint/index.js +3 -0
- package/dist/eslint-B0bQR0lJ.js +121 -0
- package/dist/index-BlfMIrXI.d.ts +6 -0
- package/dist/index-DFGyu9wF.d.ts +9 -0
- package/dist/{themes/index.d.mts → index-xzslCJW7.d.ts} +8 -7
- package/dist/index.d.ts +5 -6
- package/dist/index.js +6 -0
- package/dist/stylelint-3t_nq9An.js +115 -0
- package/dist/stylelint-9CMQiIxC.d.ts +107 -0
- package/dist/stylelint.d.ts +2 -106
- package/dist/stylelint.js +3 -0
- package/dist/themes/index.d.ts +2 -27
- package/dist/themes/index.js +3 -0
- package/dist/themes-CL2YKvqM.js +558 -0
- package/dist/unocss/index.d.ts +3 -8
- package/dist/unocss/index.js +4 -0
- package/dist/unocss-Be8qA77X.js +92 -0
- package/package.json +20 -21
- package/src/themes/utils.ts +34 -34
- package/dist/eslint/index.d.mts +0 -6
- package/dist/eslint/index.mjs +0 -6
- package/dist/index.d.mts +0 -6
- package/dist/index.mjs +0 -7
- package/dist/shared/config.CSqBb4YU.d.mts +0 -5
- package/dist/shared/config.CSqBb4YU.d.ts +0 -5
- package/dist/shared/config.D4FYsBnQ.mjs +0 -133
- package/dist/stylelint.d.mts +0 -106
- package/dist/stylelint.mjs +0 -137
- package/dist/themes/index.mjs +0 -610
- package/dist/unocss/index.d.mts +0 -8
- package/dist/unocss/index.mjs +0 -103
package/dist/unocss/index.mjs
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { definePreset as definePreset$1, transformerDirectives, presetUno, presetAttributify, presetTypography, presetIcons } from 'unocss';
|
|
2
|
-
import { definePreset, entriesToCss, toArray } from '@unocss/core';
|
|
3
|
-
import { getThemes } from '../themes/index.mjs';
|
|
4
|
-
|
|
5
|
-
const suffix = [["", " *", "::before", "::after"], ["::backdrop"]];
|
|
6
|
-
function createCssVar(key, themeName) {
|
|
7
|
-
function createSuffixScheme(preSuffix, suffixMap = suffix) {
|
|
8
|
-
return suffixMap.reduce((acc, suffix2) => acc.concat(suffix2.map((s) => `${preSuffix}${s}`).join(",")), []);
|
|
9
|
-
}
|
|
10
|
-
const map = {
|
|
11
|
-
light(key2) {
|
|
12
|
-
const preSuffix = `[data-theme="${key2}"]`;
|
|
13
|
-
return createSuffixScheme(preSuffix);
|
|
14
|
-
},
|
|
15
|
-
dark(key2) {
|
|
16
|
-
const preSuffix = `html.dark [data-theme="${key2}"]`;
|
|
17
|
-
return createSuffixScheme(preSuffix);
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
return map[key](themeName);
|
|
21
|
-
}
|
|
22
|
-
function mergeTheme(themes) {
|
|
23
|
-
const themeColor = Object.assign({}, ...themes);
|
|
24
|
-
return themeColor;
|
|
25
|
-
}
|
|
26
|
-
function normalizePreflights(_themes = []) {
|
|
27
|
-
return {
|
|
28
|
-
getCSS: () => {
|
|
29
|
-
const injectionCss = [];
|
|
30
|
-
const themes = Object.assign(getThemes(), mergeTheme(_themes));
|
|
31
|
-
Object.keys(themes).forEach((key) => {
|
|
32
|
-
delete themes[key].label;
|
|
33
|
-
const css = entriesToCss(Object.entries(themes[key]));
|
|
34
|
-
const themeColorScheme = themes[key]["color-scheme"];
|
|
35
|
-
const roots = toArray(
|
|
36
|
-
createCssVar(themeColorScheme, key)
|
|
37
|
-
);
|
|
38
|
-
injectionCss.push(roots.map((root) => `${root}{${css}}`).join(""));
|
|
39
|
-
});
|
|
40
|
-
return injectionCss.join("");
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
const presetThemes = definePreset((options) => {
|
|
45
|
-
return {
|
|
46
|
-
name: "@wsys/preset-themes",
|
|
47
|
-
preflights: [
|
|
48
|
-
normalizePreflights(options?.themes)
|
|
49
|
-
]
|
|
50
|
-
};
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
const index = definePreset$1((options) => {
|
|
54
|
-
return {
|
|
55
|
-
name: "preset-pubinfo",
|
|
56
|
-
presets: [
|
|
57
|
-
presetThemes({ themes: options?.themes }),
|
|
58
|
-
presetUno(),
|
|
59
|
-
presetAttributify(),
|
|
60
|
-
presetTypography(),
|
|
61
|
-
presetIcons({
|
|
62
|
-
extraProperties: {
|
|
63
|
-
"display": "inline-block",
|
|
64
|
-
"vertical-align": "middle"
|
|
65
|
-
}
|
|
66
|
-
})
|
|
67
|
-
],
|
|
68
|
-
transformers: [
|
|
69
|
-
transformerDirectives()
|
|
70
|
-
],
|
|
71
|
-
shortcuts: [
|
|
72
|
-
{
|
|
73
|
-
"flex-center": "flex justify-center items-center",
|
|
74
|
-
"flex-col-center": "flex flex-col justify-center items-center"
|
|
75
|
-
}
|
|
76
|
-
],
|
|
77
|
-
theme: {
|
|
78
|
-
colors: {
|
|
79
|
-
"ui-primary": "rgb(var(--ui-primary))",
|
|
80
|
-
"ui-text": "rgb(var(--ui-text))"
|
|
81
|
-
},
|
|
82
|
-
breakpoints: {
|
|
83
|
-
"sm": "768px",
|
|
84
|
-
"smd": "1024px",
|
|
85
|
-
"md": "1366px",
|
|
86
|
-
"lg": "1440px",
|
|
87
|
-
"xl": "1600px",
|
|
88
|
-
"2xl": "1920px"
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
// TOFIX 此文件中该配置不生效
|
|
92
|
-
content: {
|
|
93
|
-
pipeline: {
|
|
94
|
-
include: [
|
|
95
|
-
/\.(vue|svelte|[jt]sx|mdx?|astro|elm|php|phtml|html)($|\?)/,
|
|
96
|
-
"src/routes/**/*.ts"
|
|
97
|
-
]
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
export { index as default };
|