@yunlefun/ui 0.0.1 → 0.0.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/LICENSE +21 -0
- package/package.json +13 -3
- package/styles/css-vars.scss +121 -25
- package/styles/fonts.scss +34 -0
- package/styles/index.scss +4 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 YunLeFun Studio | 云乐坊工作室
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yunlefun/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "UI for YunLeFun",
|
|
5
5
|
"author": "YunLeFun",
|
|
6
6
|
"homepage": "https://ui.yunle.fun",
|
|
@@ -12,9 +12,19 @@
|
|
|
12
12
|
"ui",
|
|
13
13
|
"css"
|
|
14
14
|
],
|
|
15
|
+
"exports": {
|
|
16
|
+
"./styles": "./styles/index.scss",
|
|
17
|
+
"./styles/*": "./styles/*",
|
|
18
|
+
"./*": "./*"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"styles"
|
|
22
|
+
],
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"sass": "^1.101.0"
|
|
25
|
+
},
|
|
15
26
|
"scripts": {
|
|
16
27
|
"build": "",
|
|
17
|
-
"prepublishOnly": "npm run build",
|
|
18
28
|
"release": "bumpp --no-commit --no-tag --no-push && npm publish"
|
|
19
29
|
}
|
|
20
|
-
}
|
|
30
|
+
}
|
package/styles/css-vars.scss
CHANGED
|
@@ -1,34 +1,130 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// 云乐坊 · 缤纷多彩 —— 「极光云 / Iridescent Cloud」 design tokens
|
|
3
|
+
// -----------------------------------------------------------------------------
|
|
4
|
+
// 品牌色不是单一色相,而是「光穿过云」的折射:
|
|
5
|
+
// · 极光渐变 (--ylf-gradient-aurora) 是签名 —— 缤纷多彩
|
|
6
|
+
// · 鸢尾紫 (--ylf-c-brand) 是日常锚点 —— 沉静
|
|
7
|
+
// · 所有语义色都从这道光谱里取,于是再花哨也始终是一家人
|
|
8
|
+
// 组件以 var(--ylf-*) 引用这些 token(均带兜底值),加载本文件即生效。
|
|
9
|
+
// =============================================================================
|
|
10
|
+
|
|
11
|
+
:root,
|
|
12
|
+
.ylf-theme-light {
|
|
13
|
+
// --- brand 锚点:多巴胺鸢尾紫(高饱和、明快) --------------------------------
|
|
14
|
+
--ylf-c-brand: #6d5cff;
|
|
15
|
+
--ylf-c-brand-hover: #8979ff;
|
|
16
|
+
--ylf-c-brand-active: #5a46f0;
|
|
17
|
+
--ylf-c-brand-soft: #ece9ff;
|
|
18
|
+
|
|
19
|
+
// --- aurora 极光:冷调 dreamy 渐变(蓝 → 鸢尾 → 兰紫,邻近色,不再彩虹) -----
|
|
20
|
+
// 收敛到三色同族,去掉破坏协调的金/绿;签名一条连续的「夜空极光」丝带。
|
|
21
|
+
--ylf-aurora-sky: #5ba3ff;
|
|
22
|
+
--ylf-aurora-iris: #7b61ff;
|
|
23
|
+
--ylf-aurora-pink: #e879c6;
|
|
24
|
+
--ylf-gradient-aurora: linear-gradient(115deg, #5ba3ff 0%, #7b61ff 50%, #e879c6 100%);
|
|
25
|
+
--ylf-gradient-brand: linear-gradient(120deg, #5ba3ff 0%, #6d5cff 55%, #8b6bff 100%);
|
|
26
|
+
|
|
27
|
+
// --- semantic 多巴胺语义色(明快实色) --------------------------------------
|
|
28
|
+
--ylf-c-success: #10c18c;
|
|
29
|
+
--ylf-c-warning: #ffb02e;
|
|
30
|
+
--ylf-c-danger: #ff4d6d;
|
|
31
|
+
--ylf-c-info: #2c8cff;
|
|
32
|
+
|
|
33
|
+
// --- neutrals 晴空中性色 ----------------------------------------------------
|
|
34
|
+
--ylf-c-bg: #fbfcff;
|
|
35
|
+
--ylf-c-bg-soft: #f2f5fc;
|
|
36
|
+
--ylf-c-bg-mute: #e8ecf7;
|
|
37
|
+
--ylf-c-surface: #ffffff;
|
|
38
|
+
|
|
39
|
+
--ylf-c-text: #1b2238;
|
|
40
|
+
--ylf-c-text-2: #5a6178;
|
|
41
|
+
--ylf-c-text-3: #9098ad;
|
|
42
|
+
--ylf-c-text-on-accent: #ffffff;
|
|
43
|
+
|
|
44
|
+
--ylf-c-border: #e5e9f3;
|
|
45
|
+
--ylf-c-border-strong: #d3d9ea;
|
|
46
|
+
--ylf-c-overlay: rgba(13, 17, 32, 0.45);
|
|
5
47
|
|
|
6
|
-
|
|
7
|
-
--ylf-
|
|
48
|
+
// --- glass 云玻璃 -----------------------------------------------------------
|
|
49
|
+
--ylf-glass-bg: rgba(255, 255, 255, 0.62);
|
|
50
|
+
--ylf-glass-border: rgba(255, 255, 255, 0.7);
|
|
51
|
+
--ylf-glass-blur: saturate(160%) blur(16px);
|
|
8
52
|
|
|
9
|
-
|
|
10
|
-
--ylf-
|
|
11
|
-
--ylf-
|
|
12
|
-
--ylf-
|
|
13
|
-
|
|
14
|
-
--ylf-
|
|
15
|
-
--ylf-c-bg-light: #f5f5f5;
|
|
16
|
-
--ylf-c-bg-lighter: #eee;
|
|
53
|
+
// --- radius 圆角(云是软的) ------------------------------------------------
|
|
54
|
+
--ylf-radius-sm: 10px;
|
|
55
|
+
--ylf-radius: 14px;
|
|
56
|
+
--ylf-radius-lg: 20px;
|
|
57
|
+
--ylf-radius-xl: 28px;
|
|
58
|
+
--ylf-radius-pill: 999px;
|
|
17
59
|
|
|
18
|
-
|
|
60
|
+
// --- shadow 色染柔影(投影带品牌色而非灰) ----------------------------------
|
|
61
|
+
--ylf-shadow-sm: 0 2px 8px -2px rgba(110, 123, 255, 0.16);
|
|
62
|
+
--ylf-shadow: 0 10px 28px -8px rgba(110, 123, 255, 0.22);
|
|
63
|
+
--ylf-shadow-lg: 0 22px 56px -14px rgba(109, 92, 255, 0.3);
|
|
64
|
+
// 实色主按钮辉光(品牌色);极光辉光留给 aurora 变体
|
|
65
|
+
--ylf-glow-brand: 0 10px 30px -6px rgba(109, 92, 255, 0.45);
|
|
66
|
+
--ylf-glow-aurora: 0 10px 30px -6px rgba(124, 92, 255, 0.5);
|
|
67
|
+
|
|
68
|
+
// --- typography -------------------------------------------------------------
|
|
69
|
+
// 圆体做展示字,呼应「云是软的」:拉丁 Baloo 2 + 中文 ZCOOL KuaiLe 站酷快乐体
|
|
70
|
+
// (Google Fonts / OFL,圆润活泼)。Baloo 2 无中文字形,故中文需要补一款圆体 display。
|
|
71
|
+
// 逐字回退 (per-glyph fallback):
|
|
72
|
+
// 拉丁 / 数字 → Baloo 2
|
|
73
|
+
// 中文 → ZCOOL KuaiLe(需加载,仅 display 角色)
|
|
74
|
+
// → ui-rounded / 丸ゴシック(系统圆体兜底)
|
|
75
|
+
// → 苹方 / 雅黑(非圆体系统中文,最终兜底)→ sans-serif
|
|
76
|
+
// 字体加载见 ./fonts.scss 或文档 /guide/typography;正文请用 --ylf-font-body(零 webfont)。
|
|
77
|
+
--ylf-font-display:
|
|
78
|
+
'Baloo 2', 'ZCOOL KuaiLe', ui-rounded, 'Hiragino Maru Gothic ProN', 'Hiragino Maru Gothic Pro', 'PingFang SC',
|
|
79
|
+
'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', 'Source Han Sans SC', sans-serif;
|
|
80
|
+
// 品牌字 wordmark(如「云乐坊」):目前等同 display,独立 token 便于单独调校字重/字距
|
|
81
|
+
--ylf-font-wordmark: var(--ylf-font-display);
|
|
82
|
+
--ylf-font-body: 'Inter', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
|
|
83
|
+
|
|
84
|
+
// --- transition -------------------------------------------------------------
|
|
85
|
+
--ylf-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
86
|
+
|
|
87
|
+
// --- 向后兼容别名(旧组件仍在用) -------------------------------------------
|
|
88
|
+
--ylf-c-primary: var(--ylf-c-brand);
|
|
89
|
+
--ylf-c-text-light: var(--ylf-c-text-2);
|
|
90
|
+
--ylf-c-text-lighter: var(--ylf-c-text-3);
|
|
91
|
+
--ylf-c-text-lightest: var(--ylf-c-border-strong);
|
|
92
|
+
--ylf-c-bg-light: var(--ylf-c-bg-soft);
|
|
93
|
+
--ylf-c-bg-lighter: var(--ylf-c-bg-mute);
|
|
19
94
|
}
|
|
20
95
|
|
|
21
|
-
.dark
|
|
22
|
-
|
|
96
|
+
.dark,
|
|
97
|
+
.ylf-theme-dark {
|
|
98
|
+
--ylf-c-brand: #8e7cff;
|
|
99
|
+
--ylf-c-brand-hover: #a99bff;
|
|
100
|
+
--ylf-c-brand-active: #7565f5;
|
|
101
|
+
--ylf-c-brand-soft: #231d52;
|
|
102
|
+
|
|
103
|
+
--ylf-c-success: #2ee0a6;
|
|
104
|
+
--ylf-c-warning: #ffc04d;
|
|
105
|
+
--ylf-c-danger: #ff6b85;
|
|
106
|
+
--ylf-c-info: #59abff;
|
|
107
|
+
|
|
108
|
+
// 深色 = 夜空(不是死黑,是深蓝夜空)
|
|
109
|
+
--ylf-c-bg: #0d1120;
|
|
110
|
+
--ylf-c-bg-soft: #141a2e;
|
|
111
|
+
--ylf-c-bg-mute: #1e2541;
|
|
112
|
+
--ylf-c-surface: #161c32;
|
|
113
|
+
|
|
114
|
+
--ylf-c-text: #f1f3fb;
|
|
115
|
+
--ylf-c-text-2: #aab2cc;
|
|
116
|
+
--ylf-c-text-3: #6e7693;
|
|
23
117
|
|
|
24
|
-
--ylf-c-
|
|
25
|
-
--ylf-c-
|
|
26
|
-
--ylf-c-
|
|
27
|
-
--ylf-c-text-lightest: #666;
|
|
118
|
+
--ylf-c-border: #283054;
|
|
119
|
+
--ylf-c-border-strong: #354068;
|
|
120
|
+
--ylf-c-overlay: rgba(3, 6, 18, 0.7);
|
|
28
121
|
|
|
29
|
-
--ylf-
|
|
30
|
-
--ylf-
|
|
31
|
-
--ylf-c-bg-lighter: #555;
|
|
122
|
+
--ylf-glass-bg: rgba(22, 28, 50, 0.55);
|
|
123
|
+
--ylf-glass-border: rgba(139, 150, 255, 0.18);
|
|
32
124
|
|
|
33
|
-
--ylf-
|
|
125
|
+
--ylf-shadow-sm: 0 2px 10px -2px rgba(0, 0, 0, 0.5);
|
|
126
|
+
--ylf-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.55);
|
|
127
|
+
--ylf-shadow-lg: 0 24px 60px -14px rgba(0, 0, 0, 0.6);
|
|
128
|
+
--ylf-glow-brand: 0 12px 34px -6px rgba(142, 124, 255, 0.5);
|
|
129
|
+
--ylf-glow-aurora: 0 12px 34px -6px rgba(142, 124, 255, 0.55);
|
|
34
130
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// 云乐坊 · 圆体字体加载(CDN)/ Rounded display webfonts via CDN
|
|
3
|
+
// -----------------------------------------------------------------------------
|
|
4
|
+
// 只为「展示 / 标题」角色加载圆体;正文走 --ylf-font-body(纯系统字体,零下载)。
|
|
5
|
+
// 字族 token 与完整回退链见 ./css-vars.scss,说明见文档 /guide/typography。
|
|
6
|
+
//
|
|
7
|
+
// ⚠️ 性能 / Perf:CSS `@import` 是串行阻塞加载。若你能控制页面 <head>,更推荐改用
|
|
8
|
+
// <link rel="preconnect"> + <link rel="stylesheet">(文档里给了片段),可省掉本文件。
|
|
9
|
+
// 本文件是「零配置」兜底:`@use '@yunlefun/ui/styles/fonts'` 即自动带上字体
|
|
10
|
+
// (`@yunlefun/ui/styles` 仅含 token,保持零 webfont)。
|
|
11
|
+
// =============================================================================
|
|
12
|
+
|
|
13
|
+
// Latin 圆体 —— Baloo 2(仅取展示常用字重)
|
|
14
|
+
@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700;800&display=swap');
|
|
15
|
+
|
|
16
|
+
// 中文圆体 —— ZCOOL KuaiLe 站酷快乐体
|
|
17
|
+
// (1) 品牌字「云乐坊」文本子集:体积极小,保证 wordmark 首屏即刻以圆体渲染
|
|
18
|
+
@import url('https://fonts.googleapis.com/css2?family=ZCOOL+KuaiLe&text=%E4%BA%91%E4%B9%90%E5%9D%8A&display=swap');
|
|
19
|
+
// (2) 完整字族:Google Fonts 自动按 unicode-range 分片,页面只下载实际渲染到的字形分片,
|
|
20
|
+
// 正文用系统字体则永不触发整包下载。
|
|
21
|
+
@import url('https://fonts.googleapis.com/css2?family=ZCOOL+KuaiLe&display=swap');
|
|
22
|
+
|
|
23
|
+
// 角色工具类(按需 opt-in)/ role utilities
|
|
24
|
+
.ylf-font-display {
|
|
25
|
+
font-family: var(--ylf-font-display);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.ylf-font-wordmark {
|
|
29
|
+
font-family: var(--ylf-font-wordmark);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.ylf-font-body {
|
|
33
|
+
font-family: var(--ylf-font-body);
|
|
34
|
+
}
|
package/styles/index.scss
CHANGED