@yh-ui/yh-ui 0.1.17 → 0.1.22
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 +249 -9
- package/dist/resolver.cjs +14 -0
- package/dist/resolver.d.cts +4 -0
- package/dist/resolver.d.mts +1 -0
- package/dist/resolver.d.ts +4 -0
- package/dist/resolver.mjs +1 -0
- package/dist/style.css +584 -0
- package/package.json +11 -8
package/README.md
CHANGED
|
@@ -14,47 +14,287 @@
|
|
|
14
14
|
<a href="https://www.npmjs.com/package/@yh-ui/yh-ui">
|
|
15
15
|
<img src="https://img.shields.io/npm/v/@yh-ui/yh-ui.svg?style=flat-square&colorB=409eff" alt="npm version">
|
|
16
16
|
</a>
|
|
17
|
+
<a href="https://github.com/1079161148/yh-ui/actions/workflows/ci.yml">
|
|
18
|
+
<img src="https://img.shields.io/github/actions/workflow/status/1079161148/yh-ui/ci.yml?style=flat-square&label=CI&colorB=67c23a" alt="CI Status">
|
|
19
|
+
</a>
|
|
20
|
+
<a href="https://www.npmjs.com/package/@yh-ui/yh-ui">
|
|
21
|
+
<img src="https://img.shields.io/npm/dm/@yh-ui/yh-ui.svg?style=flat-square&colorB=409eff" alt="npm downloads">
|
|
22
|
+
</a>
|
|
23
|
+
<a href="https://github.com/1079161148/yh-ui/blob/main/LICENSE">
|
|
24
|
+
<img src="https://img.shields.io/npm/l/@yh-ui/yh-ui.svg?style=flat-square" alt="license">
|
|
25
|
+
</a>
|
|
26
|
+
</p>
|
|
27
|
+
|
|
28
|
+
<p align="center">
|
|
17
29
|
<a href="https://1079161148.github.io/yh-ui/">📖 文档</a> ·
|
|
18
|
-
<a href="https://1079161148.github.io/yh-ui/guide/quickstart">🚀 快速开始</a>
|
|
30
|
+
<a href="https://1079161148.github.io/yh-ui/guide/quickstart">🚀 快速开始</a> ·
|
|
31
|
+
<a href="https://github.com/1079161148/yh-ui/releases">📝 更新日志</a>
|
|
19
32
|
</p>
|
|
20
33
|
|
|
21
34
|
---
|
|
22
35
|
|
|
23
|
-
## ✨
|
|
36
|
+
## ✨ 为什么选择 YH-UI?
|
|
24
37
|
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
38
|
+
| 特性 | YH-UI | Element Plus | Naive UI |
|
|
39
|
+
| --------------- | ------------------- | ------------ | -------- |
|
|
40
|
+
| 预设主题数 | **12 种** | 1 种 | 有限 |
|
|
41
|
+
| 色盲友好模式 | ✅ **4 种** | ❌ | ❌ |
|
|
42
|
+
| 国际化语言数 | **67 种** | 43 种 | 25 种 |
|
|
43
|
+
| Nuxt 3 原生模块 | ✅ **官方级** | ❌ | ❌ |
|
|
44
|
+
| WCAG 无障碍 | ✅ **自动校验** | 手动 | 手动 |
|
|
45
|
+
| 主题切换动画 | ✅ | ❌ | ❌ |
|
|
46
|
+
| 密度配置 | ✅ **3 档** | ❌ | ❌ |
|
|
47
|
+
| Table 虚拟滚动 | ✅ | 部分 | 部分 |
|
|
48
|
+
| Table 打印/导出 | ✅ **CSV/XLSX/PDF** | ❌ | ❌ |
|
|
49
|
+
| **AI 交互套件** | ✅ **16 个组件** | ❌ | ❌ |
|
|
50
|
+
| 工业级甘特图 | ✅ | ❌ | ❌ |
|
|
51
|
+
| 节点流程编辑器 | ✅ | ❌ | ❌ |
|
|
52
|
+
|
|
53
|
+
---
|
|
30
54
|
|
|
31
55
|
## 📦 安装
|
|
32
56
|
|
|
33
57
|
```bash
|
|
34
|
-
# pnpm
|
|
58
|
+
# pnpm(推荐)
|
|
35
59
|
pnpm add @yh-ui/yh-ui
|
|
36
60
|
|
|
37
61
|
# npm
|
|
38
62
|
npm install @yh-ui/yh-ui
|
|
63
|
+
|
|
64
|
+
# yarn
|
|
65
|
+
yarn add @yh-ui/yh-ui
|
|
39
66
|
```
|
|
40
67
|
|
|
68
|
+
**环境要求**:Node.js `>=18.0.0`,Vue `>=3.5.0`
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
41
72
|
## 🔨 快速开始
|
|
42
73
|
|
|
74
|
+
### 完整引入
|
|
75
|
+
|
|
43
76
|
```ts
|
|
77
|
+
// main.ts
|
|
44
78
|
import { createApp } from 'vue'
|
|
45
79
|
import YhUI from '@yh-ui/yh-ui'
|
|
46
|
-
import '@yh-ui/yh-ui/css'
|
|
80
|
+
import '@yh-ui/yh-ui/css' // 引入样式(含主题变量)
|
|
81
|
+
import App from './App.vue'
|
|
47
82
|
|
|
48
83
|
const app = createApp(App)
|
|
49
84
|
app.use(YhUI)
|
|
50
85
|
app.mount('#app')
|
|
51
86
|
```
|
|
52
87
|
|
|
88
|
+
### 按需引入(推荐,完美 Tree-shaking)
|
|
89
|
+
|
|
90
|
+
```vue
|
|
91
|
+
<script setup lang="ts">
|
|
92
|
+
import { YhButton, YhInput, YhTable } from '@yh-ui/yh-ui'
|
|
93
|
+
</script>
|
|
94
|
+
|
|
95
|
+
<template>
|
|
96
|
+
<YhButton type="primary" @click="submit">提交</YhButton>
|
|
97
|
+
<YhInput v-model="keyword" clearable placeholder="请输入..." />
|
|
98
|
+
</template>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### 自动导入(配合 unplugin-vue-components)
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
// vite.config.ts
|
|
105
|
+
import Components from 'unplugin-vue-components/vite'
|
|
106
|
+
import { YhUIResolver } from '@yh-ui/yh-ui/resolver'
|
|
107
|
+
|
|
108
|
+
export default {
|
|
109
|
+
plugins: [
|
|
110
|
+
Components({
|
|
111
|
+
resolvers: [YhUIResolver()]
|
|
112
|
+
})
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
`YhUIResolver()` 默认会自动按需注入组件 CSS,无需额外的 Sass 依赖。
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## 🎨 主题系统
|
|
122
|
+
|
|
123
|
+
```ts
|
|
124
|
+
import { createYhTheme } from '@yh-ui/yh-ui'
|
|
125
|
+
|
|
126
|
+
const theme = createYhTheme({
|
|
127
|
+
preset: 'purple', // 12 种预设主题
|
|
128
|
+
algorithm: 'vibrant', // 4 种颜色算法
|
|
129
|
+
density: 'compact', // 3 档密度:compact | default | comfortable
|
|
130
|
+
colorBlindMode: 'protanopia', // 4 种色盲友好模式
|
|
131
|
+
followSystem: true, // 跟随系统暗色
|
|
132
|
+
transition: true, // 丝滑切换动画
|
|
133
|
+
persist: true // 持久化到 localStorage
|
|
134
|
+
})
|
|
135
|
+
|
|
136
|
+
app.use(theme)
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
在组件中动态切换:
|
|
140
|
+
|
|
141
|
+
```vue
|
|
142
|
+
<script setup lang="ts">
|
|
143
|
+
import { useTheme } from '@yh-ui/yh-ui'
|
|
144
|
+
const { setPreset, toggleDark, setDensity, isDark } = useTheme()
|
|
145
|
+
</script>
|
|
146
|
+
|
|
147
|
+
<template>
|
|
148
|
+
<YhButton @click="toggleDark()">{{ isDark ? '亮色' : '暗色' }}</YhButton>
|
|
149
|
+
<YhButton @click="setPreset('ocean')">Ocean 主题</YhButton>
|
|
150
|
+
</template>
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## 🌍 国际化
|
|
156
|
+
|
|
157
|
+
```ts
|
|
158
|
+
import YhUI from '@yh-ui/yh-ui'
|
|
159
|
+
import zhCN from '@yh-ui/yh-ui/locale/zh-CN'
|
|
160
|
+
import enUS from '@yh-ui/yh-ui/locale/en'
|
|
161
|
+
|
|
162
|
+
// 初始化时指定
|
|
163
|
+
app.use(YhUI, { locale: zhCN })
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
动态切换语言:
|
|
167
|
+
|
|
168
|
+
```vue
|
|
169
|
+
<script setup lang="ts">
|
|
170
|
+
import { ref } from 'vue'
|
|
171
|
+
import { YhConfigProvider } from '@yh-ui/yh-ui'
|
|
172
|
+
import zhCN from '@yh-ui/yh-ui/locale/zh-CN'
|
|
173
|
+
import enUS from '@yh-ui/yh-ui/locale/en'
|
|
174
|
+
|
|
175
|
+
const locale = ref(zhCN)
|
|
176
|
+
</script>
|
|
177
|
+
|
|
178
|
+
<template>
|
|
179
|
+
<YhConfigProvider :locale="locale">
|
|
180
|
+
<App />
|
|
181
|
+
</YhConfigProvider>
|
|
182
|
+
<button @click="locale = enUS">English</button>
|
|
183
|
+
</template>
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## 📊 企业级 Table
|
|
189
|
+
|
|
190
|
+
```vue
|
|
191
|
+
<YhTable
|
|
192
|
+
:data="tableData"
|
|
193
|
+
:columns="columns"
|
|
194
|
+
:virtual-config="{ enabled: true, rowHeight: 40 }"
|
|
195
|
+
:drag-config="{ row: true, column: true }"
|
|
196
|
+
:toolbar-config="{ export: true, print: true, columnSetting: true }"
|
|
197
|
+
:selection-config="{ type: 'checkbox' }"
|
|
198
|
+
:summary-config="{ method: sumMethod }"
|
|
199
|
+
height="600px"
|
|
200
|
+
border
|
|
201
|
+
stripe
|
|
202
|
+
/>
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## 🤖 AI 组件套件
|
|
208
|
+
|
|
209
|
+
```vue
|
|
210
|
+
<script setup lang="ts">
|
|
211
|
+
import { ref } from 'vue'
|
|
212
|
+
import { YhAiProvider, YhAiBubble, YhAiSender } from '@yh-ui/yh-ui'
|
|
213
|
+
import { useAIChat } from '@yh-ui/ai-sdk/vue'
|
|
214
|
+
|
|
215
|
+
const { messages, input, isLoading, sendMessage } = useAIChat({ api: '/api/chat' })
|
|
216
|
+
</script>
|
|
217
|
+
|
|
218
|
+
<template>
|
|
219
|
+
<YhAiProvider :token="apiKey">
|
|
220
|
+
<div class="chat-container">
|
|
221
|
+
<YhAiBubble
|
|
222
|
+
v-for="msg in messages"
|
|
223
|
+
:key="msg.id"
|
|
224
|
+
:role="msg.role"
|
|
225
|
+
:content="msg.content"
|
|
226
|
+
streaming
|
|
227
|
+
stream-mode="word"
|
|
228
|
+
/>
|
|
229
|
+
</div>
|
|
230
|
+
<YhAiSender v-model="input" :loading="isLoading" @send="sendMessage" />
|
|
231
|
+
</YhAiProvider>
|
|
232
|
+
</template>
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## 🔌 Nuxt 3 集成
|
|
238
|
+
|
|
239
|
+
```ts
|
|
240
|
+
// nuxt.config.ts
|
|
241
|
+
export default defineNuxtConfig({
|
|
242
|
+
modules: ['@yh-ui/nuxt'],
|
|
243
|
+
yhUI: {
|
|
244
|
+
importStyle: true, // 默认即为 true:自动注入 CSS;只有关闭后才需要显式恢复
|
|
245
|
+
locale: 'zh-CN' // 默认语言
|
|
246
|
+
}
|
|
247
|
+
})
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
注册模块后,所有组件和 composable 自动导入,无需手动 `import`:
|
|
251
|
+
|
|
252
|
+
```vue
|
|
253
|
+
<template>
|
|
254
|
+
<!-- 直接使用,无需导入 -->
|
|
255
|
+
<YhButton type="primary">按钮</YhButton>
|
|
256
|
+
<YhTable :data="data" :columns="columns" />
|
|
257
|
+
</template>
|
|
258
|
+
|
|
259
|
+
<script setup>
|
|
260
|
+
// useNamespace、useLocale 等也自动导入
|
|
261
|
+
const ns = useNamespace('my-comp')
|
|
262
|
+
</script>
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## 📦 包说明
|
|
268
|
+
|
|
269
|
+
`@yh-ui/yh-ui` 是整合包,包含:
|
|
270
|
+
|
|
271
|
+
| 子包 | 说明 |
|
|
272
|
+
| ------------------- | --------------------- |
|
|
273
|
+
| `@yh-ui/components` | 77+ 核心 UI 组件 |
|
|
274
|
+
| `@yh-ui/hooks` | Composition API Hooks |
|
|
275
|
+
| `@yh-ui/theme` | 主题系统 |
|
|
276
|
+
| `@yh-ui/utils` | 工具函数 |
|
|
277
|
+
|
|
278
|
+
其他可选包(按需安装):
|
|
279
|
+
|
|
280
|
+
| 包名 | 说明 |
|
|
281
|
+
| ---------------- | ------------------- |
|
|
282
|
+
| `@yh-ui/nuxt` | Nuxt 3 模块 |
|
|
283
|
+
| `@yh-ui/ai-sdk` | AI SDK 集成 |
|
|
284
|
+
| `@yh-ui/locale` | 67 种语言包 |
|
|
285
|
+
| `@yh-ui/icons` | 图标系统(Iconify) |
|
|
286
|
+
| `@yh-ui/flow` | 流程图 / 节点编辑器 |
|
|
287
|
+
| `@yh-ui/request` | 企业级请求 Hooks |
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
53
291
|
## 🔗 相关资源
|
|
54
292
|
|
|
55
293
|
- [📖 官方文档](https://1079161148.github.io/yh-ui/)
|
|
294
|
+
- [🚀 快速开始](https://1079161148.github.io/yh-ui/guide/quickstart)
|
|
56
295
|
- [📦 GitHub 仓库](https://github.com/1079161148/yh-ui)
|
|
57
296
|
- [📝 更新日志](https://github.com/1079161148/yh-ui/blob/main/CHANGELOG.md)
|
|
297
|
+
- [🐛 问题反馈](https://github.com/1079161148/yh-ui/issues)
|
|
58
298
|
|
|
59
299
|
## 📄 开源协议
|
|
60
300
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const resolver = require('@yh-ui/components/resolver');
|
|
6
|
+
|
|
7
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
8
|
+
|
|
9
|
+
const resolver__default = /*#__PURE__*/_interopDefaultCompat(resolver);
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
exports.YhUIResolver = resolver.YhUIResolver;
|
|
14
|
+
exports.default = resolver__default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { YhUIResolver, YhUIResolverOptions, default } from '@yh-ui/components/resolver';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { YhUIResolver, default } from '@yh-ui/components/resolver';
|
package/dist/style.css
ADDED
|
@@ -0,0 +1,584 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
/**
|
|
3
|
+
* YH-UI Base Styles
|
|
4
|
+
* 主入口文件 —— 仅包含基础主题层
|
|
5
|
+
* 组件样式由各组件的 Vue SFC <style> 块自行携带
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* YH-UI CSS Variables
|
|
9
|
+
* 全局 CSS 变量定义 - 业内最佳主题系统
|
|
10
|
+
*/
|
|
11
|
+
:root {
|
|
12
|
+
/* ==================== 密度/紧凑度系统 ==================== */
|
|
13
|
+
--yh-density-factor: 1;
|
|
14
|
+
--yh-component-size-default: 32px;
|
|
15
|
+
--yh-component-size-small: 24px;
|
|
16
|
+
--yh-component-size-large: 40px;
|
|
17
|
+
--yh-padding-default: 12px 16px;
|
|
18
|
+
--yh-padding-small: 8px 12px;
|
|
19
|
+
--yh-padding-large: 16px 20px;
|
|
20
|
+
--yh-spacing-unit: 8px;
|
|
21
|
+
/* ==================== 基础颜色 ==================== */
|
|
22
|
+
--yh-color-white: #ffffff;
|
|
23
|
+
--yh-color-black: #000000;
|
|
24
|
+
/* ==================== 颜色系统 ==================== */
|
|
25
|
+
/* 主色 */
|
|
26
|
+
--yh-color-primary: #409eff;
|
|
27
|
+
--yh-color-primary-light-1: #53a8ff;
|
|
28
|
+
--yh-color-primary-light-2: #66b1ff;
|
|
29
|
+
--yh-color-primary-light-3: #79bbff;
|
|
30
|
+
--yh-color-primary-light-4: #8cc5ff;
|
|
31
|
+
--yh-color-primary-light-5: #a0cfff;
|
|
32
|
+
--yh-color-primary-light-6: #b3d8ff;
|
|
33
|
+
--yh-color-primary-light-7: #c6e2ff;
|
|
34
|
+
--yh-color-primary-light-8: #d9ecff;
|
|
35
|
+
--yh-color-primary-light-9: #ecf5ff;
|
|
36
|
+
--yh-color-primary-dark-2: #337ecc;
|
|
37
|
+
/* 成功色 */
|
|
38
|
+
--yh-color-success: #67c23a;
|
|
39
|
+
--yh-color-success-light-3: #95d475;
|
|
40
|
+
--yh-color-success-light-5: #b3e19d;
|
|
41
|
+
--yh-color-success-light-7: #d1edc4;
|
|
42
|
+
--yh-color-success-light-9: #f0f9eb;
|
|
43
|
+
--yh-color-success-dark-2: #529b2e;
|
|
44
|
+
/* 警告色 */
|
|
45
|
+
--yh-color-warning: #e6a23c;
|
|
46
|
+
--yh-color-warning-light-3: #eebe77;
|
|
47
|
+
--yh-color-warning-light-5: #f3d19e;
|
|
48
|
+
--yh-color-warning-light-7: #f8e3c5;
|
|
49
|
+
--yh-color-warning-light-9: #fdf6ec;
|
|
50
|
+
--yh-color-warning-dark-2: #b88230;
|
|
51
|
+
/* 危险色 */
|
|
52
|
+
--yh-color-danger: #f56c6c;
|
|
53
|
+
--yh-color-danger-light-3: #f89898;
|
|
54
|
+
--yh-color-danger-light-5: #fab6b6;
|
|
55
|
+
--yh-color-danger-light-7: #fcd3d3;
|
|
56
|
+
--yh-color-danger-light-9: #fef0f0;
|
|
57
|
+
--yh-color-danger-dark-2: #c45656;
|
|
58
|
+
/* 信息色 */
|
|
59
|
+
--yh-color-info: #909399;
|
|
60
|
+
--yh-color-info-light-3: #b1b3b8;
|
|
61
|
+
--yh-color-info-light-5: #c8c9cc;
|
|
62
|
+
--yh-color-info-light-7: #dedfe0;
|
|
63
|
+
--yh-color-info-light-9: #f4f4f5;
|
|
64
|
+
--yh-color-info-dark-2: #73767a;
|
|
65
|
+
/* 文字颜色 */
|
|
66
|
+
--yh-text-color-primary: #303133;
|
|
67
|
+
--yh-text-color-regular: #606266;
|
|
68
|
+
--yh-text-color-secondary: #909399;
|
|
69
|
+
--yh-text-color-placeholder: #a8abb2;
|
|
70
|
+
--yh-text-color-disabled: #c0c4cc;
|
|
71
|
+
/* 边框颜色 */
|
|
72
|
+
--yh-border-color: #dcdfe6;
|
|
73
|
+
--yh-border-color-hover: var(--yh-color-primary);
|
|
74
|
+
--yh-border-color-light: #e4e7ed;
|
|
75
|
+
--yh-border-color-lighter: #ebeef5;
|
|
76
|
+
--yh-border-color-extra-light: #f2f6fc;
|
|
77
|
+
--yh-border-color-dark: #d4d7de;
|
|
78
|
+
--yh-border-color-darker: #cdd0d6;
|
|
79
|
+
/* 填充颜色 */
|
|
80
|
+
--yh-fill-color: #f0f2f5;
|
|
81
|
+
--yh-fill-color-light: #f5f7fa;
|
|
82
|
+
--yh-fill-color-lighter: #fafafa;
|
|
83
|
+
--yh-fill-color-extra-light: #fafcff;
|
|
84
|
+
--yh-fill-color-dark: #ebedf0;
|
|
85
|
+
--yh-fill-color-darker: #e6e8eb;
|
|
86
|
+
--yh-fill-color-blank: #ffffff;
|
|
87
|
+
/* 背景颜色 */
|
|
88
|
+
--yh-bg-color: #ffffff;
|
|
89
|
+
--yh-bg-color-page: #f2f3f5;
|
|
90
|
+
--yh-bg-color-overlay: #ffffff;
|
|
91
|
+
/* ==================== 间距系统 ==================== */
|
|
92
|
+
--yh-spacing-none: 0;
|
|
93
|
+
--yh-spacing-xs: 4px;
|
|
94
|
+
--yh-spacing-sm: 8px;
|
|
95
|
+
--yh-spacing-md: 16px;
|
|
96
|
+
--yh-spacing-lg: 24px;
|
|
97
|
+
--yh-spacing-xl: 32px;
|
|
98
|
+
--yh-spacing-xxl: 48px;
|
|
99
|
+
/* ==================== 圆角系统 ==================== */
|
|
100
|
+
--yh-radius-none: 0;
|
|
101
|
+
--yh-radius-sm: 2px;
|
|
102
|
+
--yh-radius-base: 4px;
|
|
103
|
+
--yh-radius-md: 8px;
|
|
104
|
+
--yh-radius-lg: 12px;
|
|
105
|
+
--yh-radius-xl: 16px;
|
|
106
|
+
--yh-radius-round: 20px;
|
|
107
|
+
--yh-radius-circle: 50%;
|
|
108
|
+
/* ==================== 字体系统 ==================== */
|
|
109
|
+
--yh-font-family:
|
|
110
|
+
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans',
|
|
111
|
+
sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
|
112
|
+
/* 字号 */
|
|
113
|
+
--yh-font-size-xs: 12px;
|
|
114
|
+
--yh-font-size-sm: 13px;
|
|
115
|
+
--yh-font-size-base: 14px;
|
|
116
|
+
--yh-font-size-md: 16px;
|
|
117
|
+
--yh-font-size-lg: 18px;
|
|
118
|
+
--yh-font-size-xl: 20px;
|
|
119
|
+
--yh-font-size-xxl: 24px;
|
|
120
|
+
/* 行高 */
|
|
121
|
+
--yh-line-height-none: 1;
|
|
122
|
+
--yh-line-height-tight: 1.25;
|
|
123
|
+
--yh-line-height-snug: 1.375;
|
|
124
|
+
--yh-line-height-normal: 1.5;
|
|
125
|
+
--yh-line-height-relaxed: 1.625;
|
|
126
|
+
--yh-line-height-loose: 2;
|
|
127
|
+
/* 字重 */
|
|
128
|
+
--yh-font-weight-light: 300;
|
|
129
|
+
--yh-font-weight-normal: 400;
|
|
130
|
+
--yh-font-weight-medium: 500;
|
|
131
|
+
--yh-font-weight-semibold: 600;
|
|
132
|
+
--yh-font-weight-bold: 700;
|
|
133
|
+
/* ==================== 阴影系统 ==================== */
|
|
134
|
+
--yh-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
|
135
|
+
--yh-shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
|
|
136
|
+
--yh-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
|
|
137
|
+
--yh-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
|
|
138
|
+
--yh-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
|
|
139
|
+
/* ==================== 过渡动效 ==================== */
|
|
140
|
+
--yh-duration-fast: 150ms;
|
|
141
|
+
--yh-duration-base: 200ms;
|
|
142
|
+
--yh-duration-slow: 300ms;
|
|
143
|
+
--yh-timing-ease: ease;
|
|
144
|
+
--yh-timing-ease-in: cubic-bezier(0.4, 0, 1, 1);
|
|
145
|
+
--yh-timing-ease-out: cubic-bezier(0, 0, 0.2, 1);
|
|
146
|
+
--yh-timing-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
|
|
147
|
+
--yh-timing-linear: linear;
|
|
148
|
+
--yh-transition-base: all var(--yh-duration-base) var(--yh-timing-ease-in-out);
|
|
149
|
+
--yh-transition-fast: all var(--yh-duration-fast) var(--yh-timing-ease-in-out);
|
|
150
|
+
--yh-transition-slow: all var(--yh-duration-slow) var(--yh-timing-ease-in-out);
|
|
151
|
+
/* ==================== 层级系统 ==================== */
|
|
152
|
+
--yh-z-index-normal: 1;
|
|
153
|
+
--yh-z-index-top: 1000;
|
|
154
|
+
--yh-z-index-popper: 2000;
|
|
155
|
+
--yh-z-index-overlay: 2001;
|
|
156
|
+
--yh-z-index-modal: 2002;
|
|
157
|
+
--yh-z-index-popover: 2003;
|
|
158
|
+
--yh-z-index-tooltip: 2004;
|
|
159
|
+
--yh-z-index-loading: 2005;
|
|
160
|
+
/* ==================== 组件尺寸 ==================== */
|
|
161
|
+
/* Large */
|
|
162
|
+
--yh-component-size-large: 40px;
|
|
163
|
+
--yh-component-size-large-font: 14px;
|
|
164
|
+
--yh-component-size-large-padding: 20px;
|
|
165
|
+
/* Default */
|
|
166
|
+
--yh-component-size-default: 32px;
|
|
167
|
+
--yh-component-size-default-font: 14px;
|
|
168
|
+
--yh-component-size-default-padding: 16px;
|
|
169
|
+
/* Small */
|
|
170
|
+
--yh-component-size-small: 24px;
|
|
171
|
+
--yh-component-size-small-font: 12px;
|
|
172
|
+
--yh-component-size-small-padding: 12px;
|
|
173
|
+
/* ==================== 组件语义化变量 ==================== */
|
|
174
|
+
--yh-border-radius-base: var(--yh-radius-base);
|
|
175
|
+
--yh-border-radius-small: var(--yh-radius-sm);
|
|
176
|
+
--yh-border-radius-round: var(--yh-radius-round);
|
|
177
|
+
/* Message 消息提示 */
|
|
178
|
+
--yh-message-bg-color: var(--yh-bg-color-overlay);
|
|
179
|
+
--yh-message-border-color: var(--yh-border-color-lighter);
|
|
180
|
+
--yh-message-shadow: var(--yh-shadow-lg);
|
|
181
|
+
--yh-message-text-color: var(--yh-text-color-primary);
|
|
182
|
+
--yh-message-close-color: var(--yh-text-color-secondary);
|
|
183
|
+
--yh-message-close-hover-color: var(--yh-text-color-primary);
|
|
184
|
+
/* Notification 通知 */
|
|
185
|
+
--yh-notification-bg-color: var(--yh-bg-color-overlay);
|
|
186
|
+
--yh-notification-border-color: var(--yh-border-color-lighter);
|
|
187
|
+
--yh-notification-shadow: var(--yh-shadow-lg);
|
|
188
|
+
--yh-notification-title-color: var(--yh-text-color-primary);
|
|
189
|
+
--yh-notification-content-color: var(--yh-text-color-regular);
|
|
190
|
+
/* Badge 徽标 */
|
|
191
|
+
--yh-badge-bg-color: var(--yh-color-danger);
|
|
192
|
+
--yh-badge-text-color: #ffffff;
|
|
193
|
+
--yh-badge-border-color: var(--yh-bg-color);
|
|
194
|
+
/* Card 卡片 */
|
|
195
|
+
--yh-card-bg-color: var(--yh-bg-color-overlay);
|
|
196
|
+
--yh-card-border-color: var(--yh-border-color-lighter);
|
|
197
|
+
--yh-card-shadow: var(--yh-shadow-base);
|
|
198
|
+
--yh-card-header-padding: 18px 20px;
|
|
199
|
+
--yh-card-body-padding: 20px;
|
|
200
|
+
/* Input 输入框 */
|
|
201
|
+
--yh-input-bg-color: var(--yh-fill-color-blank);
|
|
202
|
+
--yh-input-text-color: var(--yh-text-color-regular);
|
|
203
|
+
--yh-input-border-color: var(--yh-border-color);
|
|
204
|
+
--yh-input-hover-border-color: var(--yh-color-primary);
|
|
205
|
+
--yh-input-focus-border-color: var(--yh-color-primary);
|
|
206
|
+
--yh-input-placeholder-color: var(--yh-text-color-placeholder);
|
|
207
|
+
--yh-input-icon-color: var(--yh-text-color-placeholder);
|
|
208
|
+
--yh-input-disabled-bg-color: var(--yh-fill-color-light);
|
|
209
|
+
--yh-input-disabled-text-color: var(--yh-text-color-disabled);
|
|
210
|
+
--yh-input-disabled-border-color: var(--yh-border-color-light);
|
|
211
|
+
/* Image 图片 */
|
|
212
|
+
--yh-image-placeholder-bg-color: var(--yh-fill-color-light);
|
|
213
|
+
--yh-image-placeholder-text-color: var(--yh-text-color-placeholder);
|
|
214
|
+
--yh-image-error-bg-color: var(--yh-fill-color-extra-light);
|
|
215
|
+
--yh-image-error-text-color: var(--yh-text-color-placeholder);
|
|
216
|
+
/* Image Viewer 预览器 */
|
|
217
|
+
--yh-image-viewer-mask-bg-color: rgba(0, 0, 0, 0.5);
|
|
218
|
+
--yh-image-viewer-btn-bg-color: var(--yh-text-color-regular);
|
|
219
|
+
--yh-image-viewer-btn-color: #ffffff;
|
|
220
|
+
--yh-image-viewer-btn-hover-bg-color: var(--yh-color-primary);
|
|
221
|
+
/* Calendar 日历 */
|
|
222
|
+
--yh-calendar-bg: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
|
|
223
|
+
--yh-calendar-border-color: rgba(0, 0, 0, 0.06);
|
|
224
|
+
--yh-calendar-border-radius: var(--yh-radius-xl);
|
|
225
|
+
--yh-calendar-header-bg: rgba(255, 255, 255, 0.95);
|
|
226
|
+
--yh-calendar-header-border: rgba(0, 0, 0, 0.04);
|
|
227
|
+
--yh-calendar-header-padding: 18px 22px;
|
|
228
|
+
--yh-calendar-body-padding: 14px 18px 18px;
|
|
229
|
+
/* Calendar 尺寸 */
|
|
230
|
+
--yh-calendar-cell-height: 85px;
|
|
231
|
+
--yh-calendar-cell-height-small: 52px;
|
|
232
|
+
--yh-calendar-cell-height-large: 110px;
|
|
233
|
+
--yh-calendar-cell-radius: 10px;
|
|
234
|
+
--yh-calendar-cell-radius-small: 6px;
|
|
235
|
+
--yh-calendar-cell-radius-large: 12px;
|
|
236
|
+
/* Calendar 颜色 */
|
|
237
|
+
--yh-calendar-primary: var(--yh-color-primary);
|
|
238
|
+
--yh-calendar-primary-light: rgba(59, 130, 246, 0.1);
|
|
239
|
+
--yh-calendar-selected-bg: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
|
|
240
|
+
--yh-calendar-selected-border: rgba(59, 130, 246, 0.4);
|
|
241
|
+
--yh-calendar-today-dot: var(--yh-color-primary);
|
|
242
|
+
--yh-calendar-weekend-color: #f97316;
|
|
243
|
+
--yh-calendar-disabled-color: var(--yh-text-color-disabled);
|
|
244
|
+
--yh-calendar-other-month-opacity: 0.35;
|
|
245
|
+
/* Calendar 假日 */
|
|
246
|
+
--yh-calendar-holiday-color: var(--yh-color-success);
|
|
247
|
+
--yh-calendar-holiday-bg: rgba(16, 185, 129, 0.12);
|
|
248
|
+
--yh-calendar-holiday-border: rgba(16, 185, 129, 0.25);
|
|
249
|
+
--yh-calendar-workday-color: var(--yh-color-warning);
|
|
250
|
+
--yh-calendar-workday-bg: rgba(245, 158, 11, 0.12);
|
|
251
|
+
--yh-calendar-workday-border: rgba(245, 158, 11, 0.25);
|
|
252
|
+
/* Calendar 范围选择 */
|
|
253
|
+
--yh-calendar-range-bg: rgba(59, 130, 246, 0.08);
|
|
254
|
+
--yh-calendar-range-border: rgba(59, 130, 246, 0.2);
|
|
255
|
+
/* Calendar 字体 */
|
|
256
|
+
--yh-calendar-weekday-font-size: var(--yh-font-size-sm);
|
|
257
|
+
--yh-calendar-weekday-color: var(--yh-text-color-secondary);
|
|
258
|
+
--yh-calendar-day-font-size: 15px;
|
|
259
|
+
--yh-calendar-day-color: var(--yh-text-color-primary);
|
|
260
|
+
--yh-calendar-badge-font-size: 9px;
|
|
261
|
+
/* Table 表格 */
|
|
262
|
+
--yh-table-border-color: var(--yh-border-color-lighter);
|
|
263
|
+
--yh-table-header-bg: var(--yh-fill-color-light);
|
|
264
|
+
--yh-table-header-text-color: var(--yh-text-color-primary);
|
|
265
|
+
--yh-table-header-font-weight: var(--yh-font-weight-semibold);
|
|
266
|
+
--yh-table-row-bg: var(--yh-bg-color);
|
|
267
|
+
--yh-table-row-hover-bg: var(--yh-fill-color-light);
|
|
268
|
+
--yh-table-row-stripe-bg: var(--yh-fill-color-lighter);
|
|
269
|
+
--yh-table-row-current-bg: var(--yh-color-primary-light-9);
|
|
270
|
+
--yh-table-row-selected-bg: var(--yh-color-primary-light-8);
|
|
271
|
+
--yh-table-row-success-bg: var(--yh-color-success-light-9);
|
|
272
|
+
--yh-table-row-warning-bg: var(--yh-color-warning-light-9);
|
|
273
|
+
--yh-table-text-color: var(--yh-text-color-regular);
|
|
274
|
+
--yh-table-empty-text-color: var(--yh-text-color-secondary);
|
|
275
|
+
--yh-table-font-size: var(--yh-font-size-base);
|
|
276
|
+
--yh-table-cell-padding: 12px 0;
|
|
277
|
+
--yh-table-cell-spacing: 12px;
|
|
278
|
+
--yh-table-fixed-left-shadow: inset 10px 0 8px -8px rgba(0, 0, 0, 0.15);
|
|
279
|
+
--yh-table-fixed-right-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, 0.15);
|
|
280
|
+
/* ==================== 边框基础 ==================== */
|
|
281
|
+
--yh-border-width: 1px;
|
|
282
|
+
--yh-border-style: solid;
|
|
283
|
+
--yh-border: var(--yh-border-width) var(--yh-border-style) var(--yh-border-color);
|
|
284
|
+
/* ==================== 断点系统 ==================== */
|
|
285
|
+
--yh-breakpoint-xs: 0;
|
|
286
|
+
--yh-breakpoint-sm: 576px;
|
|
287
|
+
--yh-breakpoint-md: 768px;
|
|
288
|
+
--yh-breakpoint-lg: 992px;
|
|
289
|
+
--yh-breakpoint-xl: 1200px;
|
|
290
|
+
--yh-breakpoint-xxl: 1400px;
|
|
291
|
+
/* ==================== 字体系统扩展 ==================== */
|
|
292
|
+
--yh-font-family-monospace:
|
|
293
|
+
'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
|
|
294
|
+
--yh-font-family-serif: Georgia, Cambria, 'Times New Roman', Times, serif;
|
|
295
|
+
/* ==================== 无障碍/聚焦系统 ==================== */
|
|
296
|
+
--yh-focus-ring-color: var(--yh-color-primary);
|
|
297
|
+
--yh-focus-ring-width: 2px;
|
|
298
|
+
--yh-focus-ring-offset: 2px;
|
|
299
|
+
--yh-focus-ring-opacity: 0.2;
|
|
300
|
+
--yh-focus-ring:
|
|
301
|
+
0 0 0 var(--yh-focus-ring-offset) var(--yh-bg-color),
|
|
302
|
+
0 0 0 calc(var(--yh-focus-ring-offset) + var(--yh-focus-ring-width)) var(--yh-focus-ring-color);
|
|
303
|
+
/* 高对比度模式支持 */
|
|
304
|
+
--yh-high-contrast-outline: 2px solid transparent;
|
|
305
|
+
--yh-high-contrast-outline-offset: 2px;
|
|
306
|
+
/* ==================== 滚动条样式 ==================== */
|
|
307
|
+
--yh-scrollbar-width: 6px;
|
|
308
|
+
--yh-scrollbar-thumb-color: var(--yh-text-color-disabled);
|
|
309
|
+
--yh-scrollbar-thumb-hover-color: var(--yh-text-color-secondary);
|
|
310
|
+
--yh-scrollbar-track-color: transparent;
|
|
311
|
+
--yh-scrollbar-thumb-radius: 3px;
|
|
312
|
+
/* ==================== 遮罩层 ==================== */
|
|
313
|
+
--yh-mask-color: rgba(0, 0, 0, 0.5);
|
|
314
|
+
--yh-mask-color-light: rgba(0, 0, 0, 0.3);
|
|
315
|
+
--yh-mask-color-extra-light: rgba(0, 0, 0, 0.1);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/* ==================== 暗黑模式 ==================== */
|
|
319
|
+
html.dark {
|
|
320
|
+
--yh-color-primary: #409eff;
|
|
321
|
+
--yh-color-primary-light-3: #3375b9;
|
|
322
|
+
--yh-color-primary-light-5: #2a598a;
|
|
323
|
+
--yh-color-primary-light-7: #213d5b;
|
|
324
|
+
--yh-color-primary-light-9: #18222c;
|
|
325
|
+
--yh-color-primary-dark-2: #66b1ff;
|
|
326
|
+
--yh-color-success: #67c23a;
|
|
327
|
+
--yh-color-success-light-3: #4e8e2f;
|
|
328
|
+
--yh-color-success-light-5: #3e6b27;
|
|
329
|
+
--yh-color-success-light-7: #2d481f;
|
|
330
|
+
--yh-color-success-light-9: #1d2518;
|
|
331
|
+
--yh-color-warning: #e6a23c;
|
|
332
|
+
--yh-color-warning-light-3: #a77730;
|
|
333
|
+
--yh-color-warning-light-5: #7d5b28;
|
|
334
|
+
--yh-color-warning-light-7: #533f20;
|
|
335
|
+
--yh-color-warning-light-9: #292218;
|
|
336
|
+
--yh-color-danger: #f56c6c;
|
|
337
|
+
--yh-color-danger-light-3: #b25252;
|
|
338
|
+
--yh-color-danger-light-5: #854040;
|
|
339
|
+
--yh-color-danger-light-7: #582e2e;
|
|
340
|
+
--yh-color-danger-light-9: #2b1d1d;
|
|
341
|
+
--yh-color-info: #909399;
|
|
342
|
+
--yh-color-info-light-3: #6b6d71;
|
|
343
|
+
--yh-color-info-light-5: #525457;
|
|
344
|
+
--yh-color-info-light-7: #393b3e;
|
|
345
|
+
--yh-color-info-light-9: #202124;
|
|
346
|
+
--yh-text-color-primary: #e5eaf3;
|
|
347
|
+
--yh-text-color-regular: #cfd3dc;
|
|
348
|
+
--yh-text-color-secondary: #a3a6ad;
|
|
349
|
+
--yh-text-color-placeholder: #8d9095;
|
|
350
|
+
--yh-text-color-disabled: #6c6e72;
|
|
351
|
+
--yh-border-color: #4c4d4f;
|
|
352
|
+
--yh-border-color-light: #414243;
|
|
353
|
+
--yh-border-color-lighter: #363637;
|
|
354
|
+
--yh-border-color-extra-light: #2b2b2c;
|
|
355
|
+
--yh-border-color-dark: #58585b;
|
|
356
|
+
--yh-border-color-darker: #636466;
|
|
357
|
+
--yh-fill-color: #303030;
|
|
358
|
+
--yh-fill-color-light: #262727;
|
|
359
|
+
--yh-fill-color-lighter: #1d1d1d;
|
|
360
|
+
--yh-fill-color-extra-light: #191919;
|
|
361
|
+
--yh-fill-color-dark: #39393a;
|
|
362
|
+
--yh-fill-color-darker: #424243;
|
|
363
|
+
--yh-fill-color-blank: transparent;
|
|
364
|
+
--yh-bg-color: #141414;
|
|
365
|
+
--yh-bg-color-page: #0a0a0a;
|
|
366
|
+
--yh-bg-color-overlay: #1d1e1f;
|
|
367
|
+
/* 组件暗色模式覆盖 */
|
|
368
|
+
--yh-message-bg-color: var(--yh-bg-color-overlay);
|
|
369
|
+
--yh-message-border-color: var(--yh-border-color-lighter);
|
|
370
|
+
--yh-notification-bg-color: var(--yh-bg-color-overlay);
|
|
371
|
+
--yh-notification-border-color: var(--yh-border-color-lighter);
|
|
372
|
+
--yh-badge-border-color: var(--yh-bg-color);
|
|
373
|
+
--yh-card-bg-color: var(--yh-bg-color-overlay);
|
|
374
|
+
--yh-card-border-color: var(--yh-border-color-lighter);
|
|
375
|
+
/* Calendar 暗黑模式 */
|
|
376
|
+
--yh-calendar-bg: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
|
|
377
|
+
--yh-calendar-border-color: rgba(255, 255, 255, 0.08);
|
|
378
|
+
--yh-calendar-header-bg: rgba(30, 30, 30, 0.95);
|
|
379
|
+
--yh-calendar-header-border: rgba(255, 255, 255, 0.06);
|
|
380
|
+
--yh-calendar-day-color: var(--yh-text-color-primary);
|
|
381
|
+
--yh-calendar-weekday-color: var(--yh-text-color-secondary);
|
|
382
|
+
--yh-calendar-selected-bg: linear-gradient(
|
|
383
|
+
135deg,
|
|
384
|
+
rgba(59, 130, 246, 0.2) 0%,
|
|
385
|
+
rgba(59, 130, 246, 0.1) 100%
|
|
386
|
+
);
|
|
387
|
+
/* Table 暗黑模式 */
|
|
388
|
+
--yh-table-border-color: var(--yh-border-color-lighter);
|
|
389
|
+
--yh-table-header-bg: var(--yh-fill-color-dark);
|
|
390
|
+
--yh-table-header-text-color: var(--yh-text-color-primary);
|
|
391
|
+
--yh-table-row-bg: var(--yh-bg-color);
|
|
392
|
+
--yh-table-row-hover-bg: var(--yh-fill-color);
|
|
393
|
+
--yh-table-row-stripe-bg: var(--yh-fill-color-light);
|
|
394
|
+
--yh-table-row-current-bg: var(--yh-color-primary-light-9);
|
|
395
|
+
--yh-table-row-selected-bg: var(--yh-color-primary-light-9);
|
|
396
|
+
--yh-table-row-success-bg: var(--yh-color-success-light-9);
|
|
397
|
+
--yh-table-row-warning-bg: var(--yh-color-warning-light-9);
|
|
398
|
+
--yh-table-fixed-left-shadow: inset 10px 0 8px -8px rgba(0, 0, 0, 0.3);
|
|
399
|
+
--yh-table-fixed-right-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, 0.3);
|
|
400
|
+
/* 遮罩层暗黑模式 */
|
|
401
|
+
--yh-mask-color: rgba(0, 0, 0, 0.7);
|
|
402
|
+
--yh-mask-color-light: rgba(0, 0, 0, 0.5);
|
|
403
|
+
--yh-mask-color-extra-light: rgba(0, 0, 0, 0.3);
|
|
404
|
+
/* 滚动条暗黑模式 */
|
|
405
|
+
--yh-scrollbar-thumb-color: var(--yh-fill-color-darker);
|
|
406
|
+
--yh-scrollbar-thumb-hover-color: var(--yh-text-color-placeholder);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/* ==================== 减少动画偏好支持 ==================== */
|
|
410
|
+
@media (prefers-reduced-motion: reduce) {
|
|
411
|
+
:root,
|
|
412
|
+
html.dark {
|
|
413
|
+
--yh-duration-fast: 0ms;
|
|
414
|
+
--yh-duration-base: 0ms;
|
|
415
|
+
--yh-duration-slow: 0ms;
|
|
416
|
+
--yh-transition-base: none;
|
|
417
|
+
--yh-transition-fast: none;
|
|
418
|
+
--yh-transition-slow: none;
|
|
419
|
+
}
|
|
420
|
+
*,
|
|
421
|
+
*::before,
|
|
422
|
+
*::after {
|
|
423
|
+
animation-duration: 0.01ms !important;
|
|
424
|
+
animation-iteration-count: 1 !important;
|
|
425
|
+
transition-duration: 0.01ms !important;
|
|
426
|
+
scroll-behavior: auto !important;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
/* ==================== 高对比度模式支持 ==================== */
|
|
430
|
+
@media (prefers-contrast: high) {
|
|
431
|
+
:root {
|
|
432
|
+
--yh-border-color: #000000;
|
|
433
|
+
--yh-border-color-light: #333333;
|
|
434
|
+
--yh-text-color-primary: #000000;
|
|
435
|
+
--yh-text-color-regular: #1a1a1a;
|
|
436
|
+
--yh-focus-ring-width: 3px;
|
|
437
|
+
--yh-focus-ring-color: #000000;
|
|
438
|
+
}
|
|
439
|
+
html.dark {
|
|
440
|
+
--yh-border-color: #ffffff;
|
|
441
|
+
--yh-border-color-light: #cccccc;
|
|
442
|
+
--yh-text-color-primary: #ffffff;
|
|
443
|
+
--yh-text-color-regular: #e5e5e5;
|
|
444
|
+
--yh-focus-ring-color: #ffffff;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
/* ==================== 强制颜色模式支持 (Windows 高对比度) ==================== */
|
|
448
|
+
@media (forced-colors: active) {
|
|
449
|
+
:root {
|
|
450
|
+
--yh-color-primary: LinkText;
|
|
451
|
+
--yh-border-color: ButtonBorder;
|
|
452
|
+
--yh-bg-color: Canvas;
|
|
453
|
+
--yh-text-color-primary: CanvasText;
|
|
454
|
+
--yh-focus-ring-color: Highlight;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* YH-UI Reset Styles
|
|
459
|
+
* 基础样式重置
|
|
460
|
+
*/
|
|
461
|
+
*,
|
|
462
|
+
*::before,
|
|
463
|
+
*::after {
|
|
464
|
+
box-sizing: border-box;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
html,
|
|
468
|
+
body {
|
|
469
|
+
/* 仅在变量未定义时应用默认值,防止干扰宿主框架 */
|
|
470
|
+
margin: 0;
|
|
471
|
+
padding: 0;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
html {
|
|
475
|
+
font-family: var(--yh-font-family);
|
|
476
|
+
font-size: var(--yh-font-size-base);
|
|
477
|
+
line-height: var(--yh-line-height-normal);
|
|
478
|
+
color: var(--yh-text-color-primary);
|
|
479
|
+
/* 移除强制背景色,允许 VitePress 暗黑模式控制 */
|
|
480
|
+
-webkit-font-smoothing: antialiased;
|
|
481
|
+
-moz-osx-font-smoothing: grayscale;
|
|
482
|
+
text-rendering: optimizeLegibility;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
a {
|
|
486
|
+
color: var(--yh-color-primary);
|
|
487
|
+
text-decoration: none;
|
|
488
|
+
cursor: pointer;
|
|
489
|
+
}
|
|
490
|
+
a:hover {
|
|
491
|
+
color: var(--yh-color-primary-light-3);
|
|
492
|
+
}
|
|
493
|
+
a:active {
|
|
494
|
+
color: var(--yh-color-primary-dark-2);
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
button {
|
|
498
|
+
font-family: inherit;
|
|
499
|
+
font-size: inherit;
|
|
500
|
+
line-height: inherit;
|
|
501
|
+
color: inherit;
|
|
502
|
+
background: transparent;
|
|
503
|
+
border: none;
|
|
504
|
+
cursor: pointer;
|
|
505
|
+
}
|
|
506
|
+
button:focus {
|
|
507
|
+
outline: none;
|
|
508
|
+
}
|
|
509
|
+
button:disabled {
|
|
510
|
+
cursor: not-allowed;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
input,
|
|
514
|
+
textarea,
|
|
515
|
+
select {
|
|
516
|
+
font-family: inherit;
|
|
517
|
+
font-size: inherit;
|
|
518
|
+
line-height: inherit;
|
|
519
|
+
color: inherit;
|
|
520
|
+
background: transparent;
|
|
521
|
+
border: none;
|
|
522
|
+
}
|
|
523
|
+
input:focus,
|
|
524
|
+
textarea:focus,
|
|
525
|
+
select:focus {
|
|
526
|
+
outline: none;
|
|
527
|
+
}
|
|
528
|
+
input::placeholder,
|
|
529
|
+
textarea::placeholder,
|
|
530
|
+
select::placeholder {
|
|
531
|
+
color: var(--yh-text-color-placeholder);
|
|
532
|
+
}
|
|
533
|
+
input:disabled,
|
|
534
|
+
textarea:disabled,
|
|
535
|
+
select:disabled {
|
|
536
|
+
cursor: not-allowed;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
ul,
|
|
540
|
+
ol {
|
|
541
|
+
list-style: none;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
img,
|
|
545
|
+
svg {
|
|
546
|
+
display: block;
|
|
547
|
+
max-width: 100%;
|
|
548
|
+
height: auto;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
table {
|
|
552
|
+
border-collapse: collapse;
|
|
553
|
+
border-spacing: 0;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
hr {
|
|
557
|
+
border: none;
|
|
558
|
+
border-top: 1px solid var(--yh-border-color);
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
/* 滚动条样式 */
|
|
562
|
+
::-webkit-scrollbar {
|
|
563
|
+
width: 6px;
|
|
564
|
+
height: 6px;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
::-webkit-scrollbar-track {
|
|
568
|
+
background: var(--yh-fill-color-light);
|
|
569
|
+
border-radius: 3px;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
::-webkit-scrollbar-thumb {
|
|
573
|
+
background: var(--yh-text-color-disabled);
|
|
574
|
+
border-radius: 3px;
|
|
575
|
+
}
|
|
576
|
+
::-webkit-scrollbar-thumb:hover {
|
|
577
|
+
background: var(--yh-text-color-secondary);
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
/* Firefox 滚动条 */
|
|
581
|
+
* {
|
|
582
|
+
scrollbar-width: thin;
|
|
583
|
+
scrollbar-color: var(--yh-text-color-disabled) var(--yh-fill-color-light);
|
|
584
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yh-ui/yh-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.22",
|
|
4
4
|
"description": "YH-UI - A Modern Vue 3 Component Library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -9,21 +9,24 @@
|
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
|
-
"import": "./dist/index.mjs"
|
|
12
|
+
"import": "./dist/index.mjs",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
13
14
|
},
|
|
14
15
|
"./css": "./dist/style.css",
|
|
15
16
|
"./*": {
|
|
16
|
-
"
|
|
17
|
+
"types": "./dist/*.d.ts",
|
|
18
|
+
"import": "./dist/*.mjs",
|
|
19
|
+
"require": "./dist/*.cjs"
|
|
17
20
|
}
|
|
18
21
|
},
|
|
19
22
|
"files": [
|
|
20
23
|
"dist"
|
|
21
24
|
],
|
|
22
25
|
"dependencies": {
|
|
23
|
-
"@yh-ui/
|
|
24
|
-
"@yh-ui/
|
|
25
|
-
"@yh-ui/theme": "0.1.
|
|
26
|
-
"@yh-ui/
|
|
26
|
+
"@yh-ui/hooks": "0.1.22",
|
|
27
|
+
"@yh-ui/components": "0.1.22",
|
|
28
|
+
"@yh-ui/theme": "0.1.22",
|
|
29
|
+
"@yh-ui/utils": "0.1.22"
|
|
27
30
|
},
|
|
28
31
|
"peerDependencies": {
|
|
29
32
|
"vue": "^3.5.27"
|
|
@@ -47,7 +50,7 @@
|
|
|
47
50
|
"author": "YH-UI Team",
|
|
48
51
|
"license": "MIT",
|
|
49
52
|
"scripts": {
|
|
50
|
-
"build": "unbuild",
|
|
53
|
+
"build": "unbuild && node ../../scripts/post-build-styles.mjs yh-ui",
|
|
51
54
|
"dev": "unbuild --stub"
|
|
52
55
|
}
|
|
53
56
|
}
|