@zl-ui-kit/theme 0.15.0 → 0.17.0
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/README.md +62 -62
- package/package.json +1 -1
- package/src/assets/fonts/NOTOSANS-OFL.txt +93 -93
- package/src/assets/fonts/SMILEYSANS-OFL.txt +6 -6
- package/src/common/reset.css +100 -100
- package/src/generated/theme-blue.css +115 -115
- package/src/generated/theme-dark.css +115 -115
- package/src/generated/theme-light.css +115 -115
- package/src/generated/theme-red-dark.css +115 -115
- package/src/generated/theme-red-light.css +115 -115
- package/src/index.ts +12 -12
- package/src/overrides/components.css +15 -15
- package/src/runtime/api.ts +305 -305
- package/src/utils/colors.scss +27 -27
- package/src/utils/map.scss +16 -16
- package/src/utils/theme.scss +13 -13
package/README.md
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
# @zl-ui-kit/theme
|
|
2
|
-
|
|
3
|
-
> **完整使用文档**:[`@zl-ui-kit/components` 的 README(npm 页面)](https://www.npmjs.com/package/@zl-ui-kit/components) 即 UI 组件权威文档 ——
|
|
4
|
-
> 本包的 Hooks / 工具 / 主题 / 国际化用法都在其中,本文只保留本包速查与运行前提。
|
|
5
|
-
|
|
6
|
-
ZL UI 主题引擎(决策 D7):内置 5 套主题(light/dark/red-light/red-dark/blue),`body[data-theme]` 作用域 + `--zl-*`(业务层)/`--el-*`(Element Plus 层)变量体系,支持运行时自定义主题。
|
|
7
|
-
|
|
8
|
-
## 快速上手
|
|
9
|
-
|
|
10
|
-
**① 用默认主题:只引一个 CSS,不写任何主题代码。**
|
|
11
|
-
|
|
12
|
-
```ts
|
|
13
|
-
// main.ts —— 顺序不能倒:EP 样式在前、主题在后,否则被 EP 自带默认值压掉
|
|
14
|
-
import 'element-plus/dist/index.css'
|
|
15
|
-
import '@zl-ui-kit/theme/themes.css' // 5 套全量;只要默认一套可换成 '@zl-ui-kit/theme/light'
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
引入即得到内置 `light`:主色 `#3056D3`、hover `#6e89e0`、按下 `#2645a9`、控件圆角 `4px`;
|
|
19
|
-
业务组件(`--zl-*`)与 Element Plus 控件(`--el-*`)共用同一组变量。
|
|
20
|
-
|
|
21
|
-
**② 要覆盖默认主题:在宿主侧一个入口文件里于启动时调用。**
|
|
22
|
-
|
|
23
|
-
```ts
|
|
24
|
-
import { defineTheme, enableThemePersistence, setTheme, useTheme } from '@zl-ui-kit/theme'
|
|
25
|
-
|
|
26
|
-
setTheme('dark') // 切内置主题:light / dark / red-light / red-dark / blue
|
|
27
|
-
enableThemePersistence() // 可选:刷新后保持(storage: zl-theme)
|
|
28
|
-
|
|
29
|
-
// 整套自定义:以内置主题为基线,只声明要改的量,色阶自动派生
|
|
30
|
-
defineTheme({
|
|
31
|
-
name: 'brand',
|
|
32
|
-
base: 'light',
|
|
33
|
-
colors: { primary: '#722ED1' }, // → --zl-primary-1..10 与 --el-color-primary-light-*/dark-2
|
|
34
|
-
tokens: { 'radius-base': '2px' }, // → 同时写 --el-border-radius-base,EP 控件跟着变
|
|
35
|
-
apply: true,
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
// 组件内响应式读当前主题(theme 是只读 ref,切换仍走上面那个 setTheme)
|
|
39
|
-
const { theme } = useTheme()
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
页面里只引用语义变量(`var(--el-color-primary)` / `var(--zl-*)`),不要再写色值字面量,
|
|
43
|
-
也不要把主题色“回写”到另一个变量上 —— 取色单源才能避免组件一个色系、控件另一个色系。
|
|
44
|
-
|
|
45
|
-
**默认与定制的完整选型(L1 变量直覆 / L2 运行时 defineTheme / L3 构建时生成)、色阶契约与不生效排查见
|
|
46
|
-
`@zl-ui-kit/components` 的 README §10 主题定制**;可运行的实时版(含「当前实际生效值」读数)见 playground `/theme` 页。
|
|
47
|
-
|
|
48
|
-
## 入口
|
|
49
|
-
|
|
50
|
-
| 入口 | 内容 |
|
|
51
|
-
| --------------------------------------------------------------- | ---------------------------------------------------------------------- |
|
|
52
|
-
| `.` | 运行时 API(defineTheme/setTheme/useTheme/mix/generateElShades)+ 常量 |
|
|
53
|
-
| `/light` `/dark` `/red-light` `/red-dark` `/blue` `/themes.css` | 每主题/合集预编译 CSS(变量 + reset + overrides) |
|
|
54
|
-
| `/scss`(及 `/scss/*.scss`) | SCSS 工具(colorForEach/colorGradient/theme mixin/mapGet) |
|
|
55
|
-
| `/assets/*` | 主题背景图 |
|
|
56
|
-
|
|
57
|
-
## 本地调试
|
|
58
|
-
|
|
59
|
-
- 改 `_json/*.json`(主题 token)→ `pnpm --filter @zl-ui-kit/theme gen` → playground `/theme` 页刷新
|
|
60
|
-
- `pnpm build` = gen + tsup;themegen 产物在 `src/generated/`(勿手改)
|
|
61
|
-
|
|
62
|
-
详见 `@zl-ui-kit/components` README §11;发布见 `docs/发布流程.md`。
|
|
1
|
+
# @zl-ui-kit/theme
|
|
2
|
+
|
|
3
|
+
> **完整使用文档**:[`@zl-ui-kit/components` 的 README(npm 页面)](https://www.npmjs.com/package/@zl-ui-kit/components) 即 UI 组件权威文档 ——
|
|
4
|
+
> 本包的 Hooks / 工具 / 主题 / 国际化用法都在其中,本文只保留本包速查与运行前提。
|
|
5
|
+
|
|
6
|
+
ZL UI 主题引擎(决策 D7):内置 5 套主题(light/dark/red-light/red-dark/blue),`body[data-theme]` 作用域 + `--zl-*`(业务层)/`--el-*`(Element Plus 层)变量体系,支持运行时自定义主题。
|
|
7
|
+
|
|
8
|
+
## 快速上手
|
|
9
|
+
|
|
10
|
+
**① 用默认主题:只引一个 CSS,不写任何主题代码。**
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
// main.ts —— 顺序不能倒:EP 样式在前、主题在后,否则被 EP 自带默认值压掉
|
|
14
|
+
import 'element-plus/dist/index.css'
|
|
15
|
+
import '@zl-ui-kit/theme/themes.css' // 5 套全量;只要默认一套可换成 '@zl-ui-kit/theme/light'
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
引入即得到内置 `light`:主色 `#3056D3`、hover `#6e89e0`、按下 `#2645a9`、控件圆角 `4px`;
|
|
19
|
+
业务组件(`--zl-*`)与 Element Plus 控件(`--el-*`)共用同一组变量。
|
|
20
|
+
|
|
21
|
+
**② 要覆盖默认主题:在宿主侧一个入口文件里于启动时调用。**
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { defineTheme, enableThemePersistence, setTheme, useTheme } from '@zl-ui-kit/theme'
|
|
25
|
+
|
|
26
|
+
setTheme('dark') // 切内置主题:light / dark / red-light / red-dark / blue
|
|
27
|
+
enableThemePersistence() // 可选:刷新后保持(storage: zl-theme)
|
|
28
|
+
|
|
29
|
+
// 整套自定义:以内置主题为基线,只声明要改的量,色阶自动派生
|
|
30
|
+
defineTheme({
|
|
31
|
+
name: 'brand',
|
|
32
|
+
base: 'light',
|
|
33
|
+
colors: { primary: '#722ED1' }, // → --zl-primary-1..10 与 --el-color-primary-light-*/dark-2
|
|
34
|
+
tokens: { 'radius-base': '2px' }, // → 同时写 --el-border-radius-base,EP 控件跟着变
|
|
35
|
+
apply: true,
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
// 组件内响应式读当前主题(theme 是只读 ref,切换仍走上面那个 setTheme)
|
|
39
|
+
const { theme } = useTheme()
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
页面里只引用语义变量(`var(--el-color-primary)` / `var(--zl-*)`),不要再写色值字面量,
|
|
43
|
+
也不要把主题色“回写”到另一个变量上 —— 取色单源才能避免组件一个色系、控件另一个色系。
|
|
44
|
+
|
|
45
|
+
**默认与定制的完整选型(L1 变量直覆 / L2 运行时 defineTheme / L3 构建时生成)、色阶契约与不生效排查见
|
|
46
|
+
`@zl-ui-kit/components` 的 README §10 主题定制**;可运行的实时版(含「当前实际生效值」读数)见 playground `/theme` 页。
|
|
47
|
+
|
|
48
|
+
## 入口
|
|
49
|
+
|
|
50
|
+
| 入口 | 内容 |
|
|
51
|
+
| --------------------------------------------------------------- | ---------------------------------------------------------------------- |
|
|
52
|
+
| `.` | 运行时 API(defineTheme/setTheme/useTheme/mix/generateElShades)+ 常量 |
|
|
53
|
+
| `/light` `/dark` `/red-light` `/red-dark` `/blue` `/themes.css` | 每主题/合集预编译 CSS(变量 + reset + overrides) |
|
|
54
|
+
| `/scss`(及 `/scss/*.scss`) | SCSS 工具(colorForEach/colorGradient/theme mixin/mapGet) |
|
|
55
|
+
| `/assets/*` | 主题背景图 |
|
|
56
|
+
|
|
57
|
+
## 本地调试
|
|
58
|
+
|
|
59
|
+
- 改 `_json/*.json`(主题 token)→ `pnpm --filter @zl-ui-kit/theme gen` → playground `/theme` 页刷新
|
|
60
|
+
- `pnpm build` = gen + tsup;themegen 产物在 `src/generated/`(勿手改)
|
|
61
|
+
|
|
62
|
+
详见 `@zl-ui-kit/components` README §11;发布见 `docs/发布流程.md`。
|
package/package.json
CHANGED
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
Google Inc.
|
|
2
|
-
|
|
3
|
-
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
-
This license is copied below, and is also available with a FAQ at:
|
|
5
|
-
http://scripts.sil.org/OFL
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
-----------------------------------------------------------
|
|
9
|
-
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
-
-----------------------------------------------------------
|
|
11
|
-
|
|
12
|
-
PREAMBLE
|
|
13
|
-
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
-
development of collaborative font projects, to support the font creation
|
|
15
|
-
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
-
open framework in which fonts may be shared and improved in partnership
|
|
17
|
-
with others.
|
|
18
|
-
|
|
19
|
-
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
-
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
-
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
-
redistributed and/or sold with any software provided that any reserved
|
|
23
|
-
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
-
however, cannot be released under any other type of license. The
|
|
25
|
-
requirement for fonts to remain under this license does not apply
|
|
26
|
-
to any document created using the fonts or their derivatives.
|
|
27
|
-
|
|
28
|
-
DEFINITIONS
|
|
29
|
-
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
-
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
-
include source files, build scripts and documentation.
|
|
32
|
-
|
|
33
|
-
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
-
copyright statement(s).
|
|
35
|
-
|
|
36
|
-
"Original Version" refers to the collection of Font Software components as
|
|
37
|
-
distributed by the Copyright Holder(s).
|
|
38
|
-
|
|
39
|
-
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
-
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
-
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
-
new environment.
|
|
43
|
-
|
|
44
|
-
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
-
writer or other person who contributed to the Font Software.
|
|
46
|
-
|
|
47
|
-
PERMISSION & CONDITIONS
|
|
48
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
-
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
-
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
-
Software, subject to the following conditions:
|
|
52
|
-
|
|
53
|
-
1) Neither the Font Software nor any of its individual components,
|
|
54
|
-
in Original or Modified Versions, may be sold by itself.
|
|
55
|
-
|
|
56
|
-
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
-
redistributed and/or sold with any software, provided that each copy
|
|
58
|
-
contains the above copyright notice and this license. These can be
|
|
59
|
-
included either as stand-alone text files, human-readable headers or
|
|
60
|
-
in the appropriate machine-readable metadata fields within text or
|
|
61
|
-
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
-
|
|
63
|
-
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
-
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
-
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
-
presented to the users.
|
|
67
|
-
|
|
68
|
-
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
-
Software shall not be used to promote, endorse or advertise any
|
|
70
|
-
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
-
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
-
permission.
|
|
73
|
-
|
|
74
|
-
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
-
must be distributed entirely under this license, and must not be
|
|
76
|
-
distributed under any other license. The requirement for fonts to
|
|
77
|
-
remain under this license does not apply to any document created
|
|
78
|
-
using the Font Software.
|
|
79
|
-
|
|
80
|
-
TERMINATION
|
|
81
|
-
This license becomes null and void if any of the above conditions are
|
|
82
|
-
not met.
|
|
83
|
-
|
|
84
|
-
DISCLAIMER
|
|
85
|
-
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
-
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
-
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
-
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
-
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
-
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
-
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
1
|
+
Google Inc.
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
http://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Smiley Sans(得意黑)
|
|
2
|
-
作者:oooooohmygosh 等字体设计师
|
|
3
|
-
许可:SIL Open Font License 1.1(OFL-1.1),可免费商用,无任何限制
|
|
4
|
-
项目地址:https://github.com/atelier-anchor/smiley-sans
|
|
5
|
-
|
|
6
|
-
本目录内 SmileySans-Oblique.ttf.woff2 为根据上述 OFL-1.1 许可分发的字体子集包裹(@fontpkg/smiley-sans)。
|
|
1
|
+
Smiley Sans(得意黑)
|
|
2
|
+
作者:oooooohmygosh 等字体设计师
|
|
3
|
+
许可:SIL Open Font License 1.1(OFL-1.1),可免费商用,无任何限制
|
|
4
|
+
项目地址:https://github.com/atelier-anchor/smiley-sans
|
|
5
|
+
|
|
6
|
+
本目录内 SmileySans-Oblique.ttf.woff2 为根据上述 OFL-1.1 许可分发的字体子集包裹(@fontpkg/smiley-sans)。
|
package/src/common/reset.css
CHANGED
|
@@ -1,100 +1,100 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* 全局 reset(随每套主题 CSS 一并注入;变量取 --zl-*,缺省回退为浅色值)
|
|
3
|
-
* 由参考实现迁移,变量命名按需求 §7.2.1 统一 zl- 前缀
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/* ============================================================
|
|
7
|
-
* 开源字体(OFL-1.1)自托管:替换参考实现中的商业授权字体
|
|
8
|
-
* - Noto Sans SC(思源黑体):通用中文正文字体,覆盖系统字体缺失场景
|
|
9
|
-
* - Smiley Sans(得意黑):品牌标语展示字体,替换商业「方正」系列
|
|
10
|
-
* 字体文件见本包 src/assets/fonts/(经 ./assets/* 导出)
|
|
11
|
-
* ============================================================ */
|
|
12
|
-
@font-face {
|
|
13
|
-
font-family: 'Noto Sans SC';
|
|
14
|
-
font-style: normal;
|
|
15
|
-
font-weight: 400;
|
|
16
|
-
font-display: swap;
|
|
17
|
-
src: url(../assets/fonts/noto-sans-sc-400.woff2) format('woff2');
|
|
18
|
-
}
|
|
19
|
-
@font-face {
|
|
20
|
-
font-family: 'Noto Sans SC';
|
|
21
|
-
font-style: normal;
|
|
22
|
-
font-weight: 500;
|
|
23
|
-
font-display: swap;
|
|
24
|
-
src: url(../assets/fonts/noto-sans-sc-500.woff2) format('woff2');
|
|
25
|
-
}
|
|
26
|
-
@font-face {
|
|
27
|
-
font-family: 'Noto Sans SC';
|
|
28
|
-
font-style: normal;
|
|
29
|
-
font-weight: 700;
|
|
30
|
-
font-display: swap;
|
|
31
|
-
src: url(../assets/fonts/noto-sans-sc-700.woff2) format('woff2');
|
|
32
|
-
}
|
|
33
|
-
@font-face {
|
|
34
|
-
font-family: 'Smiley Sans';
|
|
35
|
-
font-style: normal;
|
|
36
|
-
font-weight: 400;
|
|
37
|
-
font-display: swap;
|
|
38
|
-
src: url(../assets/fonts/smiley-sans.woff2) format('woff2');
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
:root {
|
|
42
|
-
/* 品牌标语字体:默认得意黑(开源),回退思源黑体 / 系统字体;替换参考实现的商业字体 */
|
|
43
|
-
--zl-slogan-font-family: 'Smiley Sans', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
html,
|
|
47
|
-
body,
|
|
48
|
-
micro-app,
|
|
49
|
-
#root,
|
|
50
|
-
#app {
|
|
51
|
-
height: 100%;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
html,
|
|
55
|
-
body {
|
|
56
|
-
margin: 0;
|
|
57
|
-
padding: 0;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
#root {
|
|
61
|
-
background: var(--zl-fill-2, #f0f2f5);
|
|
62
|
-
color: var(--zl-text-2, #4d5e7d);
|
|
63
|
-
font-size: 12px;
|
|
64
|
-
line-height: 20px;
|
|
65
|
-
overscroll-behavior: contain;
|
|
66
|
-
font-family:
|
|
67
|
-
Inter,
|
|
68
|
-
-apple-system,
|
|
69
|
-
BlinkMacSystemFont,
|
|
70
|
-
'PingFang SC',
|
|
71
|
-
'Hiragino Sans GB',
|
|
72
|
-
'Noto Sans SC',
|
|
73
|
-
'Microsoft YaHei',
|
|
74
|
-
'Helvetica Neue',
|
|
75
|
-
Helvetica,
|
|
76
|
-
Arial,
|
|
77
|
-
sans-serif;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
*,
|
|
81
|
-
*::before,
|
|
82
|
-
*::after {
|
|
83
|
-
box-sizing: border-box;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
::-webkit-scrollbar {
|
|
87
|
-
width: 10px;
|
|
88
|
-
height: 10px;
|
|
89
|
-
background: transparent;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
::-webkit-scrollbar-thumb {
|
|
93
|
-
background: var(--zl-fill-3, #e3e9ef) content-box;
|
|
94
|
-
border: 2px solid transparent;
|
|
95
|
-
border-radius: 5px;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
::-webkit-scrollbar-thumb:hover {
|
|
99
|
-
background-color: var(--zl-fill-4, rgb(179, 192, 204));
|
|
100
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
* 全局 reset(随每套主题 CSS 一并注入;变量取 --zl-*,缺省回退为浅色值)
|
|
3
|
+
* 由参考实现迁移,变量命名按需求 §7.2.1 统一 zl- 前缀
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/* ============================================================
|
|
7
|
+
* 开源字体(OFL-1.1)自托管:替换参考实现中的商业授权字体
|
|
8
|
+
* - Noto Sans SC(思源黑体):通用中文正文字体,覆盖系统字体缺失场景
|
|
9
|
+
* - Smiley Sans(得意黑):品牌标语展示字体,替换商业「方正」系列
|
|
10
|
+
* 字体文件见本包 src/assets/fonts/(经 ./assets/* 导出)
|
|
11
|
+
* ============================================================ */
|
|
12
|
+
@font-face {
|
|
13
|
+
font-family: 'Noto Sans SC';
|
|
14
|
+
font-style: normal;
|
|
15
|
+
font-weight: 400;
|
|
16
|
+
font-display: swap;
|
|
17
|
+
src: url(../assets/fonts/noto-sans-sc-400.woff2) format('woff2');
|
|
18
|
+
}
|
|
19
|
+
@font-face {
|
|
20
|
+
font-family: 'Noto Sans SC';
|
|
21
|
+
font-style: normal;
|
|
22
|
+
font-weight: 500;
|
|
23
|
+
font-display: swap;
|
|
24
|
+
src: url(../assets/fonts/noto-sans-sc-500.woff2) format('woff2');
|
|
25
|
+
}
|
|
26
|
+
@font-face {
|
|
27
|
+
font-family: 'Noto Sans SC';
|
|
28
|
+
font-style: normal;
|
|
29
|
+
font-weight: 700;
|
|
30
|
+
font-display: swap;
|
|
31
|
+
src: url(../assets/fonts/noto-sans-sc-700.woff2) format('woff2');
|
|
32
|
+
}
|
|
33
|
+
@font-face {
|
|
34
|
+
font-family: 'Smiley Sans';
|
|
35
|
+
font-style: normal;
|
|
36
|
+
font-weight: 400;
|
|
37
|
+
font-display: swap;
|
|
38
|
+
src: url(../assets/fonts/smiley-sans.woff2) format('woff2');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:root {
|
|
42
|
+
/* 品牌标语字体:默认得意黑(开源),回退思源黑体 / 系统字体;替换参考实现的商业字体 */
|
|
43
|
+
--zl-slogan-font-family: 'Smiley Sans', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
html,
|
|
47
|
+
body,
|
|
48
|
+
micro-app,
|
|
49
|
+
#root,
|
|
50
|
+
#app {
|
|
51
|
+
height: 100%;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
html,
|
|
55
|
+
body {
|
|
56
|
+
margin: 0;
|
|
57
|
+
padding: 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
#root {
|
|
61
|
+
background: var(--zl-fill-2, #f0f2f5);
|
|
62
|
+
color: var(--zl-text-2, #4d5e7d);
|
|
63
|
+
font-size: 12px;
|
|
64
|
+
line-height: 20px;
|
|
65
|
+
overscroll-behavior: contain;
|
|
66
|
+
font-family:
|
|
67
|
+
Inter,
|
|
68
|
+
-apple-system,
|
|
69
|
+
BlinkMacSystemFont,
|
|
70
|
+
'PingFang SC',
|
|
71
|
+
'Hiragino Sans GB',
|
|
72
|
+
'Noto Sans SC',
|
|
73
|
+
'Microsoft YaHei',
|
|
74
|
+
'Helvetica Neue',
|
|
75
|
+
Helvetica,
|
|
76
|
+
Arial,
|
|
77
|
+
sans-serif;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
*,
|
|
81
|
+
*::before,
|
|
82
|
+
*::after {
|
|
83
|
+
box-sizing: border-box;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
::-webkit-scrollbar {
|
|
87
|
+
width: 10px;
|
|
88
|
+
height: 10px;
|
|
89
|
+
background: transparent;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
::-webkit-scrollbar-thumb {
|
|
93
|
+
background: var(--zl-fill-3, #e3e9ef) content-box;
|
|
94
|
+
border: 2px solid transparent;
|
|
95
|
+
border-radius: 5px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
::-webkit-scrollbar-thumb:hover {
|
|
99
|
+
background-color: var(--zl-fill-4, rgb(179, 192, 204));
|
|
100
|
+
}
|