@pubinfo/config 2.0.0-beta.9 → 2.0.0-rc.2
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} +9 -10
- package/dist/index.d.ts +5 -6
- package/dist/index.js +6 -0
- package/dist/stylelint-9CMQiIxC.d.ts +107 -0
- package/dist/stylelint-QHUuft1u.js +114 -0
- package/dist/stylelint.d.ts +2 -106
- package/dist/stylelint.js +3 -0
- package/dist/themes/index.d.ts +2 -29
- package/dist/themes/index.js +3 -0
- package/dist/themes-CL2YKvqM.js +558 -0
- package/dist/unocss/index.d.ts +3 -5
- package/dist/unocss/index.js +4 -0
- package/dist/unocss-Be8qA77X.js +92 -0
- package/package.json +25 -25
- package/src/eslint/config/ignores.ts +10 -0
- package/src/eslint/config/stylistic.ts +21 -0
- package/src/eslint/config/vue.ts +54 -0
- package/src/eslint/factory.ts +20 -0
- package/src/eslint/globs.ts +86 -0
- package/src/eslint/index.ts +3 -0
- package/src/index.ts +4 -0
- package/src/stylelint.ts +134 -0
- package/src/themes/index.ts +3 -0
- package/src/themes/system/dark/dark.ts +47 -0
- package/src/themes/system/dark/dracula.ts +47 -0
- package/src/themes/system/dark/luxury.ts +47 -0
- package/src/themes/system/dark/night.ts +47 -0
- package/src/themes/system/dark/stone.ts +47 -0
- package/src/themes/system/dark/synthwave.ts +47 -0
- package/src/themes/system/light/barbie.ts +47 -0
- package/src/themes/system/light/classic.ts +47 -0
- package/src/themes/system/light/cyberpunk.ts +47 -0
- package/src/themes/system/light/light.ts +47 -0
- package/src/themes/system/light/naive.ts +47 -0
- package/src/themes/system/light/winter.ts +47 -0
- package/src/themes/theme.ts +18 -0
- package/src/themes/unocss-utils.ts +52 -0
- package/src/themes/utils.ts +81 -0
- package/src/unocss/index.ts +61 -0
- package/src/unocss/presetThemes.ts +57 -0
- 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.DPEra-Xx.mjs +0 -141
- package/dist/stylelint.d.mts +0 -106
- package/dist/stylelint.mjs +0 -137
- package/dist/themes/index.mjs +0 -626
- package/dist/unocss/index.d.mts +0 -5
- package/dist/unocss/index.mjs +0 -99
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { defineTheme } from '../../utils';
|
|
2
|
+
|
|
3
|
+
export default defineTheme({
|
|
4
|
+
name: 'stone',
|
|
5
|
+
colors: {
|
|
6
|
+
'label': '石青润',
|
|
7
|
+
// 颜色主题
|
|
8
|
+
'color-scheme': 'dark',
|
|
9
|
+
// 内置 UI
|
|
10
|
+
'--ui-primary': '#68d1bf',
|
|
11
|
+
'--ui-text': '#1b1a18',
|
|
12
|
+
// 主体
|
|
13
|
+
'--g-bg': '#1b1917',
|
|
14
|
+
'--g-container-bg': '#282524',
|
|
15
|
+
'--g-border-color': '#43403c',
|
|
16
|
+
// 头部
|
|
17
|
+
'--g-header-bg': '#1b1917',
|
|
18
|
+
'--g-header-color': '#e7e5e4',
|
|
19
|
+
'--g-header-menu-color': '#e7e5e4',
|
|
20
|
+
'--g-header-menu-hover-color': '#e7e5e4',
|
|
21
|
+
'--g-header-menu-hover-bg': '#282524',
|
|
22
|
+
'--g-header-menu-active-color': '#e7e5e4',
|
|
23
|
+
'--g-header-menu-active-bg': '#282524',
|
|
24
|
+
// 主导航
|
|
25
|
+
'--g-main-sidebar-bg': '#1b1917',
|
|
26
|
+
'--g-main-sidebar-menu-color': '#e7e5e4',
|
|
27
|
+
'--g-main-sidebar-menu-hover-color': '#e7e5e4',
|
|
28
|
+
'--g-main-sidebar-menu-hover-bg': '#282524',
|
|
29
|
+
'--g-main-sidebar-menu-active-color': '#e7e5e4',
|
|
30
|
+
'--g-main-sidebar-menu-active-bg': '#282524',
|
|
31
|
+
// 次导航
|
|
32
|
+
'--g-sub-sidebar-bg': '#282524',
|
|
33
|
+
'--g-sub-sidebar-logo-color': '#e7e5e4',
|
|
34
|
+
'--g-sub-sidebar-logo-bg': '#1a103c',
|
|
35
|
+
'--g-sub-sidebar-menu-color': '#e7e5e4',
|
|
36
|
+
'--g-sub-sidebar-menu-hover-color': '#e7e5e4',
|
|
37
|
+
'--g-sub-sidebar-menu-hover-bg': '#1b1917',
|
|
38
|
+
'--g-sub-sidebar-menu-active-color': '#e7e5e4',
|
|
39
|
+
'--g-sub-sidebar-menu-active-bg': '#1b1917',
|
|
40
|
+
// 标签栏
|
|
41
|
+
'--g-tabbar-dividers-bg': '#a6adbb',
|
|
42
|
+
'--g-tabbar-tab-color': '#a6adbb',
|
|
43
|
+
'--g-tabbar-tab-hover-color': '#c8cad0',
|
|
44
|
+
'--g-tabbar-tab-hover-bg': '#282524',
|
|
45
|
+
'--g-tabbar-tab-active-color': '#c8cad0',
|
|
46
|
+
},
|
|
47
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { defineTheme } from '../../utils';
|
|
2
|
+
|
|
3
|
+
export default defineTheme({
|
|
4
|
+
name: 'synthwave',
|
|
5
|
+
colors: {
|
|
6
|
+
'label': '紫电流',
|
|
7
|
+
// 颜色主题
|
|
8
|
+
'color-scheme': 'dark',
|
|
9
|
+
// 内置 UI
|
|
10
|
+
'--ui-primary': '#58c7f3',
|
|
11
|
+
'--ui-text': '#1a272e',
|
|
12
|
+
// 主体
|
|
13
|
+
'--g-bg': '#1a103c',
|
|
14
|
+
'--g-container-bg': '#221551',
|
|
15
|
+
'--g-border-color': '#191E24',
|
|
16
|
+
// 头部
|
|
17
|
+
'--g-header-bg': '#1a103c',
|
|
18
|
+
'--g-header-color': '#f9f7fd',
|
|
19
|
+
'--g-header-menu-color': '#f9f7fd',
|
|
20
|
+
'--g-header-menu-hover-color': '#f9f7fd',
|
|
21
|
+
'--g-header-menu-hover-bg': '#221551',
|
|
22
|
+
'--g-header-menu-active-color': '#f9f7fd',
|
|
23
|
+
'--g-header-menu-active-bg': '#221551',
|
|
24
|
+
// 主导航
|
|
25
|
+
'--g-main-sidebar-bg': '#1a103c',
|
|
26
|
+
'--g-main-sidebar-menu-color': '#f9f7fd',
|
|
27
|
+
'--g-main-sidebar-menu-hover-color': '#f9f7fd',
|
|
28
|
+
'--g-main-sidebar-menu-hover-bg': '#221551',
|
|
29
|
+
'--g-main-sidebar-menu-active-color': '#f9f7fd',
|
|
30
|
+
'--g-main-sidebar-menu-active-bg': '#221551',
|
|
31
|
+
// 次导航
|
|
32
|
+
'--g-sub-sidebar-bg': '#221551',
|
|
33
|
+
'--g-sub-sidebar-logo-color': '#f9f7fd',
|
|
34
|
+
'--g-sub-sidebar-logo-bg': '#1a103c',
|
|
35
|
+
'--g-sub-sidebar-menu-color': '#f9f7fd',
|
|
36
|
+
'--g-sub-sidebar-menu-hover-color': '#f9f7fd',
|
|
37
|
+
'--g-sub-sidebar-menu-hover-bg': '#160e35',
|
|
38
|
+
'--g-sub-sidebar-menu-active-color': '#f9f7fd',
|
|
39
|
+
'--g-sub-sidebar-menu-active-bg': '#160e35',
|
|
40
|
+
// 标签栏
|
|
41
|
+
'--g-tabbar-dividers-bg': '#a6adbb',
|
|
42
|
+
'--g-tabbar-tab-color': '#a6adbb',
|
|
43
|
+
'--g-tabbar-tab-hover-color': '#c8cad0',
|
|
44
|
+
'--g-tabbar-tab-hover-bg': '#242b33',
|
|
45
|
+
'--g-tabbar-tab-active-color': '#c8cad0',
|
|
46
|
+
},
|
|
47
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { defineTheme } from '../../utils';
|
|
2
|
+
|
|
3
|
+
export default defineTheme({
|
|
4
|
+
name: 'barbie',
|
|
5
|
+
colors: {
|
|
6
|
+
'label': '梦露粉',
|
|
7
|
+
// 颜色主题
|
|
8
|
+
'color-scheme': 'light',
|
|
9
|
+
// 内置 UI
|
|
10
|
+
'--ui-primary': '#ff43bc',
|
|
11
|
+
'--ui-text': '#fcfcfc',
|
|
12
|
+
// 主体
|
|
13
|
+
'--g-bg': '#f2f2f2',
|
|
14
|
+
'--g-container-bg': '#fff',
|
|
15
|
+
'--g-border-color': '#f2f2f2',
|
|
16
|
+
// 头部
|
|
17
|
+
'--g-header-bg': '#ff43bc',
|
|
18
|
+
'--g-header-color': '#fff',
|
|
19
|
+
'--g-header-menu-color': '#fff',
|
|
20
|
+
'--g-header-menu-hover-bg': '#dd39a3',
|
|
21
|
+
'--g-header-menu-hover-color': '#fff',
|
|
22
|
+
'--g-header-menu-active-bg': '#dd39a3',
|
|
23
|
+
'--g-header-menu-active-color': '#fff',
|
|
24
|
+
// 主导航
|
|
25
|
+
'--g-main-sidebar-bg': '#ff43bc',
|
|
26
|
+
'--g-main-sidebar-menu-color': '#fff',
|
|
27
|
+
'--g-main-sidebar-menu-hover-bg': '#dd39a3',
|
|
28
|
+
'--g-main-sidebar-menu-hover-color': '#fff',
|
|
29
|
+
'--g-main-sidebar-menu-active-bg': '#dd39a3',
|
|
30
|
+
'--g-main-sidebar-menu-active-color': '#fff',
|
|
31
|
+
// 次导航
|
|
32
|
+
'--g-sub-sidebar-bg': '#fff',
|
|
33
|
+
'--g-sub-sidebar-logo-bg': '#ff43bc',
|
|
34
|
+
'--g-sub-sidebar-logo-color': '#fff',
|
|
35
|
+
'--g-sub-sidebar-menu-color': '#0f0f0f',
|
|
36
|
+
'--g-sub-sidebar-menu-hover-bg': '#dd39a3',
|
|
37
|
+
'--g-sub-sidebar-menu-hover-color': '#fff',
|
|
38
|
+
'--g-sub-sidebar-menu-active-bg': '#dd39a3',
|
|
39
|
+
'--g-sub-sidebar-menu-active-color': '#fff',
|
|
40
|
+
// 标签栏
|
|
41
|
+
'--g-tabbar-dividers-bg': '#a3a3a3',
|
|
42
|
+
'--g-tabbar-tab-color': '#a3a3a3',
|
|
43
|
+
'--g-tabbar-tab-hover-bg': '#e5e5e5',
|
|
44
|
+
'--g-tabbar-tab-hover-color': '#0f0f0f',
|
|
45
|
+
'--g-tabbar-tab-active-color': '#0f0f0f',
|
|
46
|
+
},
|
|
47
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { defineTheme } from '../../utils';
|
|
2
|
+
|
|
3
|
+
export default defineTheme({
|
|
4
|
+
name: 'classic',
|
|
5
|
+
colors: {
|
|
6
|
+
'label': '蓝古雅',
|
|
7
|
+
// 颜色主题
|
|
8
|
+
'color-scheme': 'light',
|
|
9
|
+
// 内置 UI
|
|
10
|
+
'--ui-primary': '#1677ff',
|
|
11
|
+
'--ui-text': '#fcfcfc',
|
|
12
|
+
// 主体
|
|
13
|
+
'--g-bg': '#F5F8FE',
|
|
14
|
+
'--g-container-bg': '#fff',
|
|
15
|
+
'--g-border-color': '#f2f2f2',
|
|
16
|
+
// 头部
|
|
17
|
+
'--g-header-bg': '#2264F1',
|
|
18
|
+
'--g-header-color': '#fff',
|
|
19
|
+
'--g-header-menu-color': '#fff',
|
|
20
|
+
'--g-header-menu-hover-bg': '#57A1F7',
|
|
21
|
+
'--g-header-menu-hover-color': '#fff',
|
|
22
|
+
'--g-header-menu-active-bg': '#57A1F7',
|
|
23
|
+
'--g-header-menu-active-color': '#fff',
|
|
24
|
+
// 主导航
|
|
25
|
+
'--g-main-sidebar-bg': '#222b45',
|
|
26
|
+
'--g-main-sidebar-menu-color': '#fff',
|
|
27
|
+
'--g-main-sidebar-menu-hover-bg': '#334067',
|
|
28
|
+
'--g-main-sidebar-menu-hover-color': '#fff',
|
|
29
|
+
'--g-main-sidebar-menu-active-bg': '#334067',
|
|
30
|
+
'--g-main-sidebar-menu-active-color': '#fff',
|
|
31
|
+
// 次导航
|
|
32
|
+
'--g-sub-sidebar-bg': '#F5F8FE',
|
|
33
|
+
'--g-sub-sidebar-logo-bg': '#F5F8FE',
|
|
34
|
+
'--g-sub-sidebar-logo-color': '#0f0f0f',
|
|
35
|
+
'--g-sub-sidebar-menu-color': '#0f0f0f',
|
|
36
|
+
'--g-sub-sidebar-menu-hover-bg': '#dde1e3',
|
|
37
|
+
'--g-sub-sidebar-menu-hover-color': '#0f0f0f',
|
|
38
|
+
'--g-sub-sidebar-menu-active-bg': '#F8FAFE',
|
|
39
|
+
'--g-sub-sidebar-menu-active-color': '#2264F1',
|
|
40
|
+
// 标签栏
|
|
41
|
+
'--g-tabbar-dividers-bg': '#a3a3a3',
|
|
42
|
+
'--g-tabbar-tab-color': '#a3a3a3',
|
|
43
|
+
'--g-tabbar-tab-hover-bg': '#e5e5e5',
|
|
44
|
+
'--g-tabbar-tab-hover-color': '#0f0f0f',
|
|
45
|
+
'--g-tabbar-tab-active-color': '#0f0f0f',
|
|
46
|
+
},
|
|
47
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { defineTheme } from '../../utils';
|
|
2
|
+
|
|
3
|
+
export default defineTheme({
|
|
4
|
+
name: 'cyberpunk',
|
|
5
|
+
colors: {
|
|
6
|
+
'label': '黄未来',
|
|
7
|
+
// 颜色主题
|
|
8
|
+
'color-scheme': 'light',
|
|
9
|
+
// 内置 UI
|
|
10
|
+
'--ui-primary': '#dbcb00',
|
|
11
|
+
'--ui-text': '#0f0f0f',
|
|
12
|
+
// 主体
|
|
13
|
+
'--g-bg': '#f2f2f2',
|
|
14
|
+
'--g-container-bg': '#fff',
|
|
15
|
+
'--g-border-color': '#f2f2f2',
|
|
16
|
+
// 头部
|
|
17
|
+
'--g-header-bg': '#fff',
|
|
18
|
+
'--g-header-color': '#302d12',
|
|
19
|
+
'--g-header-menu-color': '#302d12',
|
|
20
|
+
'--g-header-menu-hover-bg': '#dbcb00',
|
|
21
|
+
'--g-header-menu-hover-color': '#302d12',
|
|
22
|
+
'--g-header-menu-active-bg': '#dbcb00',
|
|
23
|
+
'--g-header-menu-active-color': '#302d12',
|
|
24
|
+
// 主导航
|
|
25
|
+
'--g-main-sidebar-bg': '#f2f2f2',
|
|
26
|
+
'--g-main-sidebar-menu-color': '#302d12',
|
|
27
|
+
'--g-main-sidebar-menu-hover-bg': '#dbcb00',
|
|
28
|
+
'--g-main-sidebar-menu-hover-color': '#302d12',
|
|
29
|
+
'--g-main-sidebar-menu-active-bg': '#dbcb00',
|
|
30
|
+
'--g-main-sidebar-menu-active-color': '#302d12',
|
|
31
|
+
// 次导航
|
|
32
|
+
'--g-sub-sidebar-bg': '#fff',
|
|
33
|
+
'--g-sub-sidebar-logo-bg': '#dbcb00',
|
|
34
|
+
'--g-sub-sidebar-logo-color': '#302d12',
|
|
35
|
+
'--g-sub-sidebar-menu-color': '#0f0f0f',
|
|
36
|
+
'--g-sub-sidebar-menu-hover-bg': '#dbcb00',
|
|
37
|
+
'--g-sub-sidebar-menu-hover-color': '#302d12',
|
|
38
|
+
'--g-sub-sidebar-menu-active-bg': '#dbcb00',
|
|
39
|
+
'--g-sub-sidebar-menu-active-color': '#302d12',
|
|
40
|
+
// 标签栏
|
|
41
|
+
'--g-tabbar-dividers-bg': '#a3a3a3',
|
|
42
|
+
'--g-tabbar-tab-color': '#a3a3a3',
|
|
43
|
+
'--g-tabbar-tab-hover-bg': '#e5e5e5',
|
|
44
|
+
'--g-tabbar-tab-hover-color': '#0f0f0f',
|
|
45
|
+
'--g-tabbar-tab-active-color': '#0f0f0f',
|
|
46
|
+
},
|
|
47
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { defineTheme } from '../../utils';
|
|
2
|
+
|
|
3
|
+
export default defineTheme({
|
|
4
|
+
name: 'light',
|
|
5
|
+
colors: {
|
|
6
|
+
'label': '幽影黑',
|
|
7
|
+
// 颜色主题
|
|
8
|
+
'color-scheme': 'light',
|
|
9
|
+
// 内置 UI
|
|
10
|
+
'--ui-primary': '#1677ff',
|
|
11
|
+
'--ui-text': '#fcfcfc',
|
|
12
|
+
// 主体
|
|
13
|
+
'--g-bg': '#f2f2f2',
|
|
14
|
+
'--g-container-bg': '#fff',
|
|
15
|
+
'--g-border-color': '#f2f2f2',
|
|
16
|
+
// 头部
|
|
17
|
+
'--g-header-bg': '#222b45',
|
|
18
|
+
'--g-header-color': '#fff',
|
|
19
|
+
'--g-header-menu-color': '#fff',
|
|
20
|
+
'--g-header-menu-hover-bg': '#334067',
|
|
21
|
+
'--g-header-menu-hover-color': '#fff',
|
|
22
|
+
'--g-header-menu-active-bg': '#334067',
|
|
23
|
+
'--g-header-menu-active-color': '#fff',
|
|
24
|
+
// 主导航
|
|
25
|
+
'--g-main-sidebar-bg': '#222b45',
|
|
26
|
+
'--g-main-sidebar-menu-color': '#fff',
|
|
27
|
+
'--g-main-sidebar-menu-hover-bg': '#334067',
|
|
28
|
+
'--g-main-sidebar-menu-hover-color': '#fff',
|
|
29
|
+
'--g-main-sidebar-menu-active-bg': '#334067',
|
|
30
|
+
'--g-main-sidebar-menu-active-color': '#fff',
|
|
31
|
+
// 次导航
|
|
32
|
+
'--g-sub-sidebar-bg': '#fff',
|
|
33
|
+
'--g-sub-sidebar-logo-bg': '#222b45',
|
|
34
|
+
'--g-sub-sidebar-logo-color': '#fff',
|
|
35
|
+
'--g-sub-sidebar-menu-color': '#0f0f0f',
|
|
36
|
+
'--g-sub-sidebar-menu-hover-bg': '#dde1e3',
|
|
37
|
+
'--g-sub-sidebar-menu-hover-color': '#0f0f0f',
|
|
38
|
+
'--g-sub-sidebar-menu-active-bg': '#1677ff',
|
|
39
|
+
'--g-sub-sidebar-menu-active-color': '#fff',
|
|
40
|
+
// 标签栏
|
|
41
|
+
'--g-tabbar-dividers-bg': '#a3a3a3',
|
|
42
|
+
'--g-tabbar-tab-color': '#a3a3a3',
|
|
43
|
+
'--g-tabbar-tab-hover-bg': '#e5e5e5',
|
|
44
|
+
'--g-tabbar-tab-hover-color': '#0f0f0f',
|
|
45
|
+
'--g-tabbar-tab-active-color': '#0f0f0f',
|
|
46
|
+
},
|
|
47
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { defineTheme } from '../../utils';
|
|
2
|
+
|
|
3
|
+
export default defineTheme({
|
|
4
|
+
name: 'naive',
|
|
5
|
+
colors: {
|
|
6
|
+
'label': '青宇古',
|
|
7
|
+
// 颜色主题
|
|
8
|
+
'color-scheme': 'light',
|
|
9
|
+
// 内置 UI
|
|
10
|
+
'--ui-primary': '#18a058',
|
|
11
|
+
'--ui-text': '#fcfcfc',
|
|
12
|
+
// 主体
|
|
13
|
+
'--g-bg': '#f2f2f2',
|
|
14
|
+
'--g-container-bg': '#fff',
|
|
15
|
+
'--g-border-color': '#f2f2f2',
|
|
16
|
+
// 头部
|
|
17
|
+
'--g-header-bg': '#1d2935',
|
|
18
|
+
'--g-header-color': '#fff',
|
|
19
|
+
'--g-header-menu-color': '#fff',
|
|
20
|
+
'--g-header-menu-hover-bg': '#42b983',
|
|
21
|
+
'--g-header-menu-hover-color': '#fff',
|
|
22
|
+
'--g-header-menu-active-bg': '#18a058',
|
|
23
|
+
'--g-header-menu-active-color': '#fff',
|
|
24
|
+
// 主导航
|
|
25
|
+
'--g-main-sidebar-bg': '#1d2935',
|
|
26
|
+
'--g-main-sidebar-menu-color': '#fff',
|
|
27
|
+
'--g-main-sidebar-menu-hover-bg': '#42b983',
|
|
28
|
+
'--g-main-sidebar-menu-hover-color': '#fff',
|
|
29
|
+
'--g-main-sidebar-menu-active-bg': '#18a058',
|
|
30
|
+
'--g-main-sidebar-menu-active-color': '#fff',
|
|
31
|
+
// 次导航
|
|
32
|
+
'--g-sub-sidebar-bg': '#fff',
|
|
33
|
+
'--g-sub-sidebar-logo-bg': '#1d2935',
|
|
34
|
+
'--g-sub-sidebar-logo-color': '#fff',
|
|
35
|
+
'--g-sub-sidebar-menu-color': '#0f0f0f',
|
|
36
|
+
'--g-sub-sidebar-menu-hover-bg': '#42b983',
|
|
37
|
+
'--g-sub-sidebar-menu-hover-color': '#fff',
|
|
38
|
+
'--g-sub-sidebar-menu-active-bg': '#18a058',
|
|
39
|
+
'--g-sub-sidebar-menu-active-color': '#fff',
|
|
40
|
+
// 标签栏
|
|
41
|
+
'--g-tabbar-dividers-bg': '#a3a3a3',
|
|
42
|
+
'--g-tabbar-tab-color': '#a3a3a3',
|
|
43
|
+
'--g-tabbar-tab-hover-bg': '#e5e5e5',
|
|
44
|
+
'--g-tabbar-tab-hover-color': '#0f0f0f',
|
|
45
|
+
'--g-tabbar-tab-active-color': '#0f0f0f',
|
|
46
|
+
},
|
|
47
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { defineTheme } from '../../utils';
|
|
2
|
+
|
|
3
|
+
export default defineTheme({
|
|
4
|
+
name: 'winter',
|
|
5
|
+
colors: {
|
|
6
|
+
'label': '冰雪蓝',
|
|
7
|
+
// 颜色主题
|
|
8
|
+
'color-scheme': 'light',
|
|
9
|
+
// 内置 UI
|
|
10
|
+
'--ui-primary': '#a6e4f8',
|
|
11
|
+
'--ui-text': '#3e4e68',
|
|
12
|
+
// 主体
|
|
13
|
+
'--g-bg': '#f1f5fe',
|
|
14
|
+
'--g-container-bg': '#fff',
|
|
15
|
+
'--g-border-color': '#f2f2f2',
|
|
16
|
+
// 头部
|
|
17
|
+
'--g-header-bg': '#fff',
|
|
18
|
+
'--g-header-color': '#3e4e68',
|
|
19
|
+
'--g-header-menu-color': '#3e4e68',
|
|
20
|
+
'--g-header-menu-hover-bg': '#e3e8f2',
|
|
21
|
+
'--g-header-menu-hover-color': '#3e4e68',
|
|
22
|
+
'--g-header-menu-active-bg': '#a6e4f8',
|
|
23
|
+
'--g-header-menu-active-color': '#3e4e68',
|
|
24
|
+
// 主导航
|
|
25
|
+
'--g-main-sidebar-bg': '#f1f5fe',
|
|
26
|
+
'--g-main-sidebar-menu-color': '#3e4e68',
|
|
27
|
+
'--g-main-sidebar-menu-hover-bg': '#e3e8f2',
|
|
28
|
+
'--g-main-sidebar-menu-hover-color': '#3e4e68',
|
|
29
|
+
'--g-main-sidebar-menu-active-bg': '#a6e4f8',
|
|
30
|
+
'--g-main-sidebar-menu-active-color': '#3e4e68',
|
|
31
|
+
// 次导航
|
|
32
|
+
'--g-sub-sidebar-bg': '#fff',
|
|
33
|
+
'--g-sub-sidebar-logo-bg': '#e3e8f2',
|
|
34
|
+
'--g-sub-sidebar-logo-color': '#3e4e68',
|
|
35
|
+
'--g-sub-sidebar-menu-color': '#0f0f0f',
|
|
36
|
+
'--g-sub-sidebar-menu-hover-bg': '#e3e8f2',
|
|
37
|
+
'--g-sub-sidebar-menu-hover-color': '#3e4e68',
|
|
38
|
+
'--g-sub-sidebar-menu-active-bg': '#a6e4f8',
|
|
39
|
+
'--g-sub-sidebar-menu-active-color': '#3e4e68',
|
|
40
|
+
// 标签栏
|
|
41
|
+
'--g-tabbar-dividers-bg': '#a3a3a3',
|
|
42
|
+
'--g-tabbar-tab-color': '#a3a3a3',
|
|
43
|
+
'--g-tabbar-tab-hover-bg': '#e5e5e5',
|
|
44
|
+
'--g-tabbar-tab-hover-color': '#0f0f0f',
|
|
45
|
+
'--g-tabbar-tab-active-color': '#0f0f0f',
|
|
46
|
+
},
|
|
47
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ========================================================================
|
|
3
|
+
* system
|
|
4
|
+
*=========================================================================
|
|
5
|
+
*/
|
|
6
|
+
import './system/dark/dark';
|
|
7
|
+
import './system/dark/dracula';
|
|
8
|
+
import './system/dark/luxury';
|
|
9
|
+
import './system/dark/night';
|
|
10
|
+
import './system/dark/stone';
|
|
11
|
+
|
|
12
|
+
import './system/dark/synthwave';
|
|
13
|
+
import './system/light/barbie';
|
|
14
|
+
import './system/light/classic';
|
|
15
|
+
import './system/light/cyberpunk';
|
|
16
|
+
import './system/light/light';
|
|
17
|
+
import './system/light/naive';
|
|
18
|
+
import './system/light/winter';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export type RGBAColorValue = [number, number, number, number] | [number, number, number];
|
|
2
|
+
|
|
3
|
+
export function hex2rgba(hex = ''): RGBAColorValue | undefined {
|
|
4
|
+
const color = parseHexColor(hex);
|
|
5
|
+
if (color != null) {
|
|
6
|
+
const { components, alpha } = color;
|
|
7
|
+
if (alpha == null) {
|
|
8
|
+
return components as [number, number, number];
|
|
9
|
+
}
|
|
10
|
+
return [...components, alpha] as [number, number, number, number];
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface CSSColorValue {
|
|
15
|
+
type: string
|
|
16
|
+
components: (string | number)[]
|
|
17
|
+
alpha: string | number | undefined
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function parseHexColor(str: string): CSSColorValue | undefined {
|
|
21
|
+
const [, body] = str.match(/^#([\da-f]+)$/i) || [];
|
|
22
|
+
if (!body) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
switch (body.length) {
|
|
27
|
+
case 3:
|
|
28
|
+
case 4: {
|
|
29
|
+
const digits = Array.from(body, s => Number.parseInt(s, 16)).map(n => (n << 4) | n);
|
|
30
|
+
return {
|
|
31
|
+
type: 'rgb',
|
|
32
|
+
components: digits.slice(0, 3),
|
|
33
|
+
alpha: body.length === 3
|
|
34
|
+
? undefined
|
|
35
|
+
: Math.round(digits[3] / 255 * 100) / 100,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
case 6:
|
|
40
|
+
case 8:{
|
|
41
|
+
const value = Number.parseInt(body, 16);
|
|
42
|
+
return {
|
|
43
|
+
type: 'rgb',
|
|
44
|
+
components: body.length === 6
|
|
45
|
+
? [(value >> 16) & 0xFF, (value >> 8) & 0xFF, value & 0xFF]
|
|
46
|
+
: [(value >> 24) & 0xFF, (value >> 16) & 0xFF, (value >> 8) & 0xFF],
|
|
47
|
+
alpha: body.length === 6
|
|
48
|
+
? undefined
|
|
49
|
+
: Math.round((value & 0xFF) / 255 * 100) / 100,
|
|
50
|
+
}; }
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { hex2rgba } from './unocss-utils';
|
|
2
|
+
|
|
3
|
+
type CSSColorValue = string;
|
|
4
|
+
type manColor
|
|
5
|
+
= | 'bg'
|
|
6
|
+
| 'container-bg'
|
|
7
|
+
| 'border-color';
|
|
8
|
+
|
|
9
|
+
type headerColor
|
|
10
|
+
= | 'header-bg'
|
|
11
|
+
| 'header-color'
|
|
12
|
+
| 'header-menu-color'
|
|
13
|
+
| 'header-menu-hover-bg'
|
|
14
|
+
| 'header-menu-hover-color'
|
|
15
|
+
| 'header-menu-active-bg'
|
|
16
|
+
| 'header-menu-active-color';
|
|
17
|
+
|
|
18
|
+
type mainSidebarColor
|
|
19
|
+
= | 'main-sidebar-bg'
|
|
20
|
+
| 'main-sidebar-menu-color'
|
|
21
|
+
| 'main-sidebar-menu-hover-bg'
|
|
22
|
+
| 'main-sidebar-menu-hover-color'
|
|
23
|
+
| 'main-sidebar-menu-active-bg'
|
|
24
|
+
| 'main-sidebar-menu-active-color';
|
|
25
|
+
|
|
26
|
+
type subSidebarColor
|
|
27
|
+
= | 'sub-sidebar-bg'
|
|
28
|
+
| 'sub-sidebar-logo-bg'
|
|
29
|
+
| 'sub-sidebar-logo-color'
|
|
30
|
+
| 'sub-sidebar-menu-color'
|
|
31
|
+
| 'sub-sidebar-menu-hover-bg'
|
|
32
|
+
| 'sub-sidebar-menu-hover-color'
|
|
33
|
+
| 'sub-sidebar-menu-active-bg'
|
|
34
|
+
| 'sub-sidebar-menu-active-color';
|
|
35
|
+
|
|
36
|
+
type tabbarColor
|
|
37
|
+
= | 'tabbar-dividers-bg'
|
|
38
|
+
| 'tabbar-tab-color'
|
|
39
|
+
| 'tabbar-tab-hover-bg'
|
|
40
|
+
| 'tabbar-tab-hover-color'
|
|
41
|
+
| 'tabbar-tab-active-color';
|
|
42
|
+
|
|
43
|
+
type themeScheme = 'light' | 'dark';
|
|
44
|
+
type customColor = typeof customColorKey[number];
|
|
45
|
+
type benchmark = `--g-${manColor | headerColor | mainSidebarColor | subSidebarColor | tabbarColor}`;
|
|
46
|
+
export type cssVarKey = customColor | benchmark;
|
|
47
|
+
|
|
48
|
+
export type colorScheme = Record<cssVarKey, CSSColorValue> & { 'color-scheme': themeScheme } & { label?: string };
|
|
49
|
+
|
|
50
|
+
export interface themeOptions {
|
|
51
|
+
name: string
|
|
52
|
+
colors: colorScheme
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export const customColorKey = ['--ui-primary', '--ui-text'] as const;
|
|
56
|
+
|
|
57
|
+
export interface globalTheme {
|
|
58
|
+
[key: string]: colorScheme
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
let themeColorMap: globalTheme = {};
|
|
62
|
+
|
|
63
|
+
export function getThemes() {
|
|
64
|
+
return themeColorMap;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function normalizeColor(colors: colorScheme) {
|
|
68
|
+
for (const key of customColorKey) {
|
|
69
|
+
const colorValue = colors[key];
|
|
70
|
+
colors[key] = hex2rgba(colorValue)!.join(' ');
|
|
71
|
+
}
|
|
72
|
+
return colors;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function defineTheme(theme: themeOptions): globalTheme {
|
|
76
|
+
const { name, colors } = theme;
|
|
77
|
+
const colorScheme: globalTheme = Object.create(null);
|
|
78
|
+
colorScheme[name] = normalizeColor(colors);
|
|
79
|
+
themeColorMap = Object.assign(themeColorMap, colorScheme);
|
|
80
|
+
return colorScheme;
|
|
81
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { globalTheme } from '../themes';
|
|
2
|
+
import {
|
|
3
|
+
definePreset,
|
|
4
|
+
presetAttributify,
|
|
5
|
+
presetIcons,
|
|
6
|
+
presetTypography,
|
|
7
|
+
presetUno,
|
|
8
|
+
transformerDirectives,
|
|
9
|
+
} from 'unocss';
|
|
10
|
+
import { presetThemes } from './presetThemes';
|
|
11
|
+
|
|
12
|
+
export default definePreset<{ themes?: globalTheme[] }>((options) => {
|
|
13
|
+
return {
|
|
14
|
+
name: 'preset-pubinfo',
|
|
15
|
+
presets: [
|
|
16
|
+
presetThemes({ themes: options?.themes }),
|
|
17
|
+
presetUno(),
|
|
18
|
+
presetAttributify(),
|
|
19
|
+
presetTypography(),
|
|
20
|
+
presetIcons({
|
|
21
|
+
extraProperties: {
|
|
22
|
+
'display': 'inline-block',
|
|
23
|
+
'vertical-align': 'middle',
|
|
24
|
+
},
|
|
25
|
+
}),
|
|
26
|
+
],
|
|
27
|
+
transformers: [
|
|
28
|
+
transformerDirectives(),
|
|
29
|
+
],
|
|
30
|
+
shortcuts: [
|
|
31
|
+
{
|
|
32
|
+
'flex-center': 'flex justify-center items-center',
|
|
33
|
+
'flex-col-center': 'flex flex-col justify-center items-center',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
theme: {
|
|
37
|
+
colors: {
|
|
38
|
+
'ui-primary': 'rgb(var(--ui-primary))',
|
|
39
|
+
'ui-text': 'rgb(var(--ui-text))',
|
|
40
|
+
},
|
|
41
|
+
breakpoints: {
|
|
42
|
+
'sm': '768px',
|
|
43
|
+
'smd': '1024px',
|
|
44
|
+
'md': '1366px',
|
|
45
|
+
'lg': '1440px',
|
|
46
|
+
'xl': '1600px',
|
|
47
|
+
'2xl': '1920px',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
// TOFIX 此文件中该配置不生效
|
|
52
|
+
content: {
|
|
53
|
+
pipeline: {
|
|
54
|
+
include: [
|
|
55
|
+
/\.(vue|svelte|[jt]sx|mdx?|astro|elm|php|phtml|html)($|\?)/,
|
|
56
|
+
'src/routes/**/*.ts',
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { globalTheme } from '../themes';
|
|
2
|
+
import { definePreset, entriesToCss, toArray } from '@unocss/core';
|
|
3
|
+
import { getThemes } from '../themes';
|
|
4
|
+
|
|
5
|
+
type colorScheme = 'light' | 'dark';
|
|
6
|
+
|
|
7
|
+
const suffix = [['', ' *', '::before', '::after'], ['::backdrop']];
|
|
8
|
+
|
|
9
|
+
function createCssVar(key: colorScheme, themeName: string) {
|
|
10
|
+
function createSuffixScheme(preSuffix: string, suffixMap = suffix) {
|
|
11
|
+
return suffixMap.reduce<string[]>((acc, suffix) => acc.concat(suffix.map(s => `${preSuffix}${s}`).join(',')), []);
|
|
12
|
+
}
|
|
13
|
+
const map = {
|
|
14
|
+
light(key: string) {
|
|
15
|
+
const preSuffix = `[data-theme="${key}"]`;
|
|
16
|
+
return createSuffixScheme(preSuffix);
|
|
17
|
+
},
|
|
18
|
+
dark(key: string) {
|
|
19
|
+
const preSuffix = `html.dark [data-theme="${key}"]`;
|
|
20
|
+
return createSuffixScheme(preSuffix);
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
return map[key](themeName);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function mergeTheme(themes: globalTheme[]): globalTheme {
|
|
27
|
+
const themeColor = Object.assign({}, ...themes);
|
|
28
|
+
return themeColor;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function normalizePreflights(_themes: globalTheme[] = []) {
|
|
32
|
+
return {
|
|
33
|
+
getCSS: () => {
|
|
34
|
+
const injectionCss: string[] = [];
|
|
35
|
+
const themes = Object.assign(getThemes(), mergeTheme(_themes));
|
|
36
|
+
Object.keys(themes).forEach((key) => {
|
|
37
|
+
delete themes[key].label;
|
|
38
|
+
const css = entriesToCss(Object.entries(themes[key]));
|
|
39
|
+
const themeColorScheme = themes[key]['color-scheme'] as colorScheme;
|
|
40
|
+
const roots = toArray(
|
|
41
|
+
createCssVar(themeColorScheme, key),
|
|
42
|
+
);
|
|
43
|
+
injectionCss.push(roots.map(root => `${root}{${css}}`).join(''));
|
|
44
|
+
});
|
|
45
|
+
return injectionCss.join('');
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export const presetThemes = definePreset<{ themes?: globalTheme[] }>((options) => {
|
|
51
|
+
return {
|
|
52
|
+
name: '@wsys/preset-themes',
|
|
53
|
+
preflights: [
|
|
54
|
+
normalizePreflights(options?.themes),
|
|
55
|
+
],
|
|
56
|
+
};
|
|
57
|
+
});
|
package/dist/eslint/index.d.mts
DELETED