@yunlefun/ui 0.0.6 → 0.1.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.
@@ -1,336 +1,445 @@
1
- // =============================================================================
2
- // YunLeFun Design —— 晴空蓝为主,高饱和纯色点缀
3
- // -----------------------------------------------------------------------------
4
- // 晴空蓝负责主操作、链接和选中状态;明黄、青、橙、粉、绿用于有明确用途的局部强调。
5
- // 语义色负责状态,前景与背景成组维护,明暗主题共享相同角色。
6
- // 组件以 var(--ylf-*) 引用这些 token(均带兜底值),加载本文件即生效。
7
- // =============================================================================
1
+ /* =============================================================================
2
+ * YunLeFun Design —— 晴空蓝为主,高饱和纯色点缀(自动生成,请勿手改)
3
+ * 源文件:packages/ui/tokens/source.mjs
4
+ * ============================================================================= */
8
5
 
9
- // 默认强调色跟随品牌主色,在每个明暗主题边界重新解析。
10
- @mixin brand-accent {
11
- --ylf-accent-blue: var(--ylf-c-brand);
12
- --ylf-accent-blue-hover: var(--ylf-c-brand-hover);
13
- --ylf-accent-blue-soft: var(--ylf-c-brand-soft);
14
- --ylf-accent-blue-text: var(--ylf-c-brand);
15
- --ylf-accent-blue-on: var(--ylf-c-text-on-accent);
6
+ @layer ylf.tokens, ylf.compat, ylf.profile, ylf.adapters;
16
7
 
17
- --ylf-accent: var(--ylf-accent-blue);
18
- --ylf-accent-hover: var(--ylf-accent-blue-hover);
19
- --ylf-accent-soft: var(--ylf-accent-blue-soft);
20
- --ylf-accent-text: var(--ylf-accent-blue-text);
21
- --ylf-accent-on: var(--ylf-accent-blue-on);
22
- }
23
-
24
- // 状态与强调色共享同一色组,在每个主题范围内重新解析别名。
25
- @mixin status-colors {
26
- @each $status, $tone in (success: green, warning: sun, danger: coral, info: cyan) {
27
- --ylf-status-#{$status}: var(--ylf-accent-#{$tone});
28
- --ylf-status-#{$status}-hover: var(--ylf-accent-#{$tone}-hover);
29
- --ylf-status-#{$status}-on: var(--ylf-accent-#{$tone}-on);
30
- --ylf-status-#{$status}-soft: var(--ylf-accent-#{$tone}-soft);
31
- --ylf-status-#{$status}-text: var(--ylf-accent-#{$tone}-text);
32
- // 旧名称用于文字;实色组件使用 status / status-on 这一对。
33
- --ylf-c-#{$status}: var(--ylf-status-#{$status}-text);
8
+ @layer ylf.tokens {
9
+ :root,
10
+ .light,
11
+ .ylf-theme-light {
12
+ --ylf-palette-blue: #2563eb;
13
+ --ylf-palette-sun: #facc15;
14
+ --ylf-palette-cyan: #06b6d4;
15
+ --ylf-palette-coral: #ff6b4a;
16
+ --ylf-palette-pink: #ec4899;
17
+ --ylf-palette-green: #22c55e;
18
+ --ylf-spectrum-stops:
19
+ var(--ylf-palette-blue) 0% 16.667%, var(--ylf-palette-cyan) 16.667% 33.333%, var(--ylf-palette-green) 33.333% 50%,
20
+ var(--ylf-palette-sun) 50% 66.667%, var(--ylf-palette-coral) 66.667% 83.333%, var(--ylf-palette-pink) 83.333% 100%;
21
+ --ylf-c-brand: var(--ylf-palette-blue);
22
+ --ylf-c-brand-hover: #1d4ed8;
23
+ --ylf-c-brand-active: #1e40af;
24
+ --ylf-c-brand-soft: #eff6ff;
25
+ --ylf-accent-blue: var(--ylf-c-brand);
26
+ --ylf-accent-blue-hover: var(--ylf-c-brand-hover);
27
+ --ylf-accent-blue-soft: var(--ylf-c-brand-soft);
28
+ --ylf-accent-blue-text: var(--ylf-c-brand);
29
+ --ylf-accent-blue-on: var(--ylf-c-text-on-accent);
30
+ --ylf-accent: var(--ylf-accent-blue);
31
+ --ylf-accent-hover: var(--ylf-accent-blue-hover);
32
+ --ylf-accent-soft: var(--ylf-accent-blue-soft);
33
+ --ylf-accent-text: var(--ylf-accent-blue-text);
34
+ --ylf-accent-on: var(--ylf-accent-blue-on);
35
+ --ylf-hero-start: #2563eb;
36
+ --ylf-hero-middle: #0f74b8;
37
+ --ylf-hero-end: #0369a1;
38
+ --ylf-hero-hover-start: #1d4ed8;
39
+ --ylf-hero-hover-middle: #096ba9;
40
+ --ylf-hero-hover-end: #075985;
41
+ --ylf-hero-foreground: #ffffff;
42
+ --ylf-hero-background: linear-gradient(
43
+ 115deg,
44
+ var(--ylf-hero-start),
45
+ var(--ylf-hero-middle) 58%,
46
+ var(--ylf-hero-end)
47
+ );
48
+ --ylf-hero-background-hover: linear-gradient(
49
+ 115deg,
50
+ var(--ylf-hero-hover-start),
51
+ var(--ylf-hero-hover-middle) 58%,
52
+ var(--ylf-hero-hover-end)
53
+ );
54
+ --ylf-hero-border: rgb(255 255 255 / 0.16);
55
+ --ylf-hero-shadow: inset 0 1px 0 rgb(255 255 255 / 0.24), 0 12px 26px -14px rgb(3 105 161 / 0.58);
56
+ --ylf-hero-shadow-hover: inset 0 1px 0 rgb(255 255 255 / 0.3), 0 14px 30px -14px rgb(3 105 161 / 0.58);
57
+ --ylf-accent-sun: var(--ylf-palette-sun);
58
+ --ylf-accent-sun-hover: #eab308;
59
+ --ylf-accent-sun-soft: #fef9c3;
60
+ --ylf-accent-sun-text: #854d0e;
61
+ --ylf-accent-sun-on: #64380e;
62
+ --ylf-accent-cyan: var(--ylf-palette-cyan);
63
+ --ylf-accent-cyan-hover: #22d3ee;
64
+ --ylf-accent-cyan-soft: #cffafe;
65
+ --ylf-accent-cyan-text: #155e75;
66
+ --ylf-accent-cyan-on: #083e4f;
67
+ --ylf-accent-coral: var(--ylf-palette-coral);
68
+ --ylf-accent-coral-hover: #ff856b;
69
+ --ylf-accent-coral-soft: #ffede6;
70
+ --ylf-accent-coral-text: #9a3412;
71
+ --ylf-accent-coral-on: #551b0a;
72
+ --ylf-accent-pink: var(--ylf-palette-pink);
73
+ --ylf-accent-pink-hover: #f472b6;
74
+ --ylf-accent-pink-soft: #fce7f3;
75
+ --ylf-accent-pink-text: #9d174d;
76
+ --ylf-accent-pink-on: #400a2b;
77
+ --ylf-accent-green: var(--ylf-palette-green);
78
+ --ylf-accent-green-hover: #4ade80;
79
+ --ylf-accent-green-soft: #dcfce7;
80
+ --ylf-accent-green-text: #166534;
81
+ --ylf-accent-green-on: #124324;
82
+ --ylf-c-feature: var(--ylf-accent-sun);
83
+ --ylf-c-feature-bg: var(--ylf-accent-sun-soft);
84
+ --ylf-c-feature-text: var(--ylf-c-text);
85
+ --ylf-status-success: var(--ylf-accent-green);
86
+ --ylf-status-success-hover: var(--ylf-accent-green-hover);
87
+ --ylf-status-success-on: var(--ylf-accent-green-on);
88
+ --ylf-status-success-soft: var(--ylf-accent-green-soft);
89
+ --ylf-status-success-text: var(--ylf-accent-green-text);
90
+ --ylf-status-warning: var(--ylf-accent-sun);
91
+ --ylf-status-warning-hover: var(--ylf-accent-sun-hover);
92
+ --ylf-status-warning-on: var(--ylf-accent-sun-on);
93
+ --ylf-status-warning-soft: var(--ylf-accent-sun-soft);
94
+ --ylf-status-warning-text: var(--ylf-accent-sun-text);
95
+ --ylf-status-danger: var(--ylf-accent-coral);
96
+ --ylf-status-danger-hover: var(--ylf-accent-coral-hover);
97
+ --ylf-status-danger-on: var(--ylf-accent-coral-on);
98
+ --ylf-status-danger-soft: var(--ylf-accent-coral-soft);
99
+ --ylf-status-danger-text: var(--ylf-accent-coral-text);
100
+ --ylf-status-info: var(--ylf-accent-cyan);
101
+ --ylf-status-info-hover: var(--ylf-accent-cyan-hover);
102
+ --ylf-status-info-on: var(--ylf-accent-cyan-on);
103
+ --ylf-status-info-soft: var(--ylf-accent-cyan-soft);
104
+ --ylf-status-info-text: var(--ylf-accent-cyan-text);
105
+ --ylf-c-bg: #f8fafc;
106
+ --ylf-c-bg-soft: #f1f5f9;
107
+ --ylf-c-bg-mute: #e2e8f0;
108
+ --ylf-c-surface: #ffffff;
109
+ --ylf-c-surface-raised: #f6f9ff;
110
+ --ylf-c-surface-inset: #edf2f8;
111
+ --ylf-c-highlight: rgba(255, 255, 255, 0.9);
112
+ --ylf-c-panel: rgba(255, 255, 255, 0.96);
113
+ --ylf-c-edge: rgba(30, 64, 115, 0.12);
114
+ --ylf-c-text: #0f172a;
115
+ --ylf-c-text-2: #475569;
116
+ --ylf-c-text-3: #5a697e;
117
+ --ylf-c-placeholder: var(--ylf-c-text-3);
118
+ --ylf-c-text-on-accent: #ffffff;
119
+ --ylf-c-border: #e2e8f0;
120
+ --ylf-c-border-strong: #cbd5e1;
121
+ --ylf-c-overlay: rgba(13, 17, 32, 0.45);
122
+ --ylf-glass-bg: rgba(255, 255, 255, 0.82);
123
+ --ylf-glass-border: rgba(255, 255, 255, 0.7);
124
+ --ylf-glass-blur: saturate(160%) blur(16px);
125
+ --ylf-overlay-blur: saturate(85%) blur(10px);
126
+ --ylf-radius-2xs: 4px;
127
+ --ylf-radius-xs: 6px;
128
+ --ylf-radius-sm: 10px;
129
+ --ylf-radius: 14px;
130
+ --ylf-radius-lg: 20px;
131
+ --ylf-radius-xl: 28px;
132
+ --ylf-radius-pill: 999px;
133
+ --ylf-shadow-sm: 0 2px 8px -2px rgba(15, 23, 42, 0.12);
134
+ --ylf-shadow: 0 10px 28px -8px rgba(15, 23, 42, 0.16);
135
+ --ylf-shadow-lg: 0 22px 56px -14px rgba(15, 23, 42, 0.22);
136
+ --ylf-shadow-control:
137
+ inset 0 1px 0 var(--ylf-c-highlight), 0 1px 2px rgba(15, 23, 42, 0.06), 0 3px 6px -4px rgba(15, 23, 42, 0.16);
138
+ --ylf-shadow-inset: inset 0 1px 3px rgba(15, 23, 42, 0.08);
139
+ --ylf-shadow-panel:
140
+ inset 0 1px 0 var(--ylf-c-highlight), 0 0 0 1px var(--ylf-c-edge), 0 8px 16px -8px rgba(15, 23, 42, 0.14),
141
+ 0 28px 64px -20px rgba(24, 52, 102, 0.24);
142
+ --ylf-glow-brand: 0 6px 18px -8px rgba(37, 99, 235, 0.35);
143
+ --ylf-glow-brand-hover: 0 8px 22px -8px rgba(37, 99, 235, 0.4);
144
+ --ylf-font-display:
145
+ 'Baloo 2', 'ZCOOL KuaiLe', ui-rounded, 'Hiragino Maru Gothic ProN', 'Hiragino Maru Gothic Pro', 'PingFang SC',
146
+ 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', 'Source Han Sans SC', sans-serif;
147
+ --ylf-font-wordmark: var(--ylf-font-display);
148
+ --ylf-font-heading:
149
+ ui-rounded, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', 'Source Han Sans SC', system-ui,
150
+ sans-serif;
151
+ --ylf-font-body: 'Inter', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
152
+ --ylf-font-ui:
153
+ -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui,
154
+ sans-serif;
155
+ --ylf-font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
156
+ --ylf-text-2xs: 0.6875rem;
157
+ --ylf-text-xs: 0.75rem;
158
+ --ylf-text-sm: 0.875rem;
159
+ --ylf-text-base: 1rem;
160
+ --ylf-text-lg: 1.25rem;
161
+ --ylf-text-xl: 1.5rem;
162
+ --ylf-text-2xl: 2rem;
163
+ --ylf-text-display: clamp(2.25rem, 4.5vw, 4rem);
164
+ --ylf-leading-heading: 1.25;
165
+ --ylf-leading-normal: 1.5;
166
+ --ylf-leading-body: 1.75;
167
+ --ylf-space-1: 4px;
168
+ --ylf-space-2: 8px;
169
+ --ylf-space-3: 12px;
170
+ --ylf-space-4: 16px;
171
+ --ylf-space-5: 20px;
172
+ --ylf-space-6: 24px;
173
+ --ylf-space-8: 32px;
174
+ --ylf-space-10: 40px;
175
+ --ylf-space-12: 48px;
176
+ --ylf-space-16: 64px;
177
+ --ylf-space-0_5: 2px;
178
+ --ylf-space-1_5: 6px;
179
+ --ylf-layout-page: 1200px;
180
+ --ylf-layout-reading: 720px;
181
+ --ylf-z-base: 1;
182
+ --ylf-z-sticky: 50;
183
+ --ylf-z-overlay: 100;
184
+ --ylf-z-modal: 101;
185
+ --ylf-z-popover: 105;
186
+ --ylf-z-tooltip: 110;
187
+ --ylf-z-toast: 120;
188
+ --ylf-ring-width: 2px;
189
+ --ylf-ring-offset: 2px;
190
+ --ylf-ring-color: var(--ylf-c-brand);
191
+ --ylf-disabled-opacity: 0.48;
192
+ --ylf-control-h-sm: 34px;
193
+ --ylf-control-h: 44px;
194
+ --ylf-control-h-lg: 48px;
195
+ --ylf-control-h-xl: 56px;
196
+ --ylf-control-radius-sm: var(--ylf-radius-sm);
197
+ --ylf-control-radius: var(--ylf-radius);
198
+ --ylf-panel-radius: var(--ylf-radius-lg);
199
+ --ylf-control-font-size-sm: 0.8125rem;
200
+ --ylf-control-font-size: 0.9375rem;
201
+ --ylf-grid-size: 32px;
202
+ --ylf-c-grid: rgba(37, 99, 235, 0.06);
203
+ --ylf-c-sky: #dbeafe;
204
+ --ylf-c-cloud: #ffffff;
205
+ --ylf-cloud-highlight: #fffefa;
206
+ --ylf-cloud-body: #f2f8ff;
207
+ --ylf-cloud-shade: #c6dff5;
208
+ --ylf-cloud-shadow: #83addb;
209
+ --ylf-cloud-rim: #ffffff;
210
+ --ylf-cloud-face: #5a7fae;
211
+ --ylf-cloud-haze-color: #9cc6ef;
212
+ --ylf-touch-target: 44px;
213
+ --ylf-viewport-gutter: 16px;
214
+ --ylf-duration-press: 100ms;
215
+ --ylf-duration-enter: 240ms;
216
+ --ylf-duration-exit: 160ms;
217
+ --ylf-press-scale: 0.98;
218
+ --ylf-hover-lift: -1px;
219
+ --ylf-duration-fast: 160ms;
220
+ --ylf-duration-normal: 240ms;
221
+ --ylf-duration-slow: 480ms;
222
+ --ylf-ease-standard: cubic-bezier(0.2, 0, 0, 1);
223
+ --ylf-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
224
+ --ylf-ease-spring: linear(
225
+ 0,
226
+ 0.009,
227
+ 0.035 2.1%,
228
+ 0.141 4.4%,
229
+ 0.723 12.9%,
230
+ 0.938 16.7%,
231
+ 1.017 19.4%,
232
+ 1.067,
233
+ 1.089 24.6%,
234
+ 1.088 27.4%,
235
+ 1.061 31.2%,
236
+ 1.008 38.7%,
237
+ 0.988 44.4%,
238
+ 0.999 61.5%,
239
+ 1
240
+ );
34
241
  }
35
- }
36
-
37
- :root,
38
- .ylf-theme-light {
39
- // --- brand:晴空蓝 ---------------------------------------------------------
40
- --ylf-c-brand: var(--ylf-palette-blue);
41
- --ylf-c-brand-hover: #1d4ed8;
42
- --ylf-c-brand-active: #1e40af;
43
- --ylf-c-brand-soft: #eff6ff;
44
-
45
- @include brand-accent;
46
-
47
- // --- palette:原始色只表达色相,不直接承担状态文字 -------------------------
48
- --ylf-palette-blue: #2563eb;
49
- --ylf-palette-sun: #facc15;
50
- --ylf-palette-cyan: #06b6d4;
51
- --ylf-palette-coral: #ff6b4a;
52
- --ylf-palette-pink: #ec4899;
53
- --ylf-palette-green: #22c55e;
54
-
55
- // 六段纯色拼接,用于品牌区分隔;不作为文字背景。
56
- --ylf-spectrum-stops:
57
- var(--ylf-palette-blue) 0% 16.667%, var(--ylf-palette-cyan) 16.667% 33.333%, var(--ylf-palette-green) 33.333% 50%,
58
- var(--ylf-palette-sun) 50% 66.667%, var(--ylf-palette-coral) 66.667% 83.333%, var(--ylf-palette-pink) 83.333% 100%;
59
-
60
- // --- accent:亮色、悬停、浅底与文字成组,明暗主题使用相同接口 ---------------
61
- --ylf-accent-sun: var(--ylf-palette-sun);
62
- --ylf-accent-sun-hover: #eab308;
63
- --ylf-accent-sun-soft: #fef9c3;
64
- --ylf-accent-sun-text: #854d0e;
65
- --ylf-accent-sun-on: #64380e;
66
- --ylf-accent-cyan: var(--ylf-palette-cyan);
67
- --ylf-accent-cyan-hover: #22d3ee;
68
- --ylf-accent-cyan-soft: #cffafe;
69
- --ylf-accent-cyan-text: #155e75;
70
- --ylf-accent-cyan-on: #083e4f;
71
- --ylf-accent-coral: var(--ylf-palette-coral);
72
- --ylf-accent-coral-hover: #ff856b;
73
- --ylf-accent-coral-soft: #ffede6;
74
- --ylf-accent-coral-text: #9a3412;
75
- --ylf-accent-coral-on: #551b0a;
76
- --ylf-accent-pink: var(--ylf-palette-pink);
77
- --ylf-accent-pink-hover: #f472b6;
78
- --ylf-accent-pink-soft: #fce7f3;
79
- --ylf-accent-pink-text: #9d174d;
80
- --ylf-accent-pink-on: #400a2b;
81
- --ylf-accent-green: var(--ylf-palette-green);
82
- --ylf-accent-green-hover: #4ade80;
83
- --ylf-accent-green-soft: #dcfce7;
84
- --ylf-accent-green-text: #166534;
85
- --ylf-accent-green-on: #124324;
86
-
87
- // 精选:明黄装饰 + 中性文字;不用于提醒或错误状态。
88
- --ylf-c-feature: var(--ylf-accent-sun);
89
- --ylf-c-feature-bg: var(--ylf-accent-sun-soft);
90
- --ylf-c-feature-text: var(--ylf-c-text);
91
-
92
- // 旧 token 仅供迁移:旧渐变已收敛为单一明黄色,不再维护紫粉极光。
93
- --ylf-aurora-sky: var(--ylf-accent-cyan);
94
- --ylf-aurora-iris: var(--ylf-accent-coral);
95
- --ylf-aurora-pink: var(--ylf-accent-pink);
96
- --ylf-gradient-aurora: linear-gradient(var(--ylf-accent-sun), var(--ylf-accent-sun));
97
- --ylf-gradient-brand: linear-gradient(var(--ylf-c-brand), var(--ylf-c-brand));
98
-
99
- // --- semantic:固定语义,复用多巴胺色板与对应前景 ---------------------------
100
- @include status-colors;
101
-
102
- // --- neutrals 晴空中性色 ----------------------------------------------------
103
- --ylf-c-bg: #f8fafc;
104
- --ylf-c-bg-soft: #f1f5f9;
105
- --ylf-c-bg-mute: #e2e8f0;
106
- --ylf-c-surface: #ffffff;
107
- --ylf-c-surface-raised: #f6f9ff;
108
- --ylf-c-surface-inset: #edf2f8;
109
- --ylf-c-highlight: rgba(255, 255, 255, 0.9);
110
- --ylf-c-panel: rgba(255, 255, 255, 0.96);
111
- --ylf-c-edge: rgba(30, 64, 115, 0.12);
112
-
113
- --ylf-c-text: #0f172a;
114
- --ylf-c-text-2: #475569;
115
- --ylf-c-text-3: #5c6b80;
116
- --ylf-c-text-on-accent: #ffffff;
117
- --ylf-c-text-on-aurora: var(--ylf-accent-sun-on);
118
-
119
- --ylf-c-border: #e2e8f0;
120
- --ylf-c-border-strong: #cbd5e1;
121
- --ylf-c-overlay: rgba(13, 17, 32, 0.45);
122
-
123
- // --- glass 云玻璃 -----------------------------------------------------------
124
- --ylf-glass-bg: rgba(255, 255, 255, 0.82);
125
- --ylf-glass-border: rgba(255, 255, 255, 0.7);
126
- --ylf-glass-blur: saturate(160%) blur(16px);
127
- --ylf-overlay-blur: saturate(85%) blur(10px);
128
-
129
- // --- radius 圆角(云是软的) ------------------------------------------------
130
- --ylf-radius-sm: 10px;
131
- --ylf-radius: 14px;
132
- --ylf-radius-lg: 20px;
133
- --ylf-radius-xl: 28px;
134
- --ylf-radius-pill: 999px;
135
-
136
- // --- shadow 色染柔影(投影带品牌色而非灰) ----------------------------------
137
- --ylf-shadow-sm: 0 2px 8px -2px rgba(15, 23, 42, 0.12);
138
- --ylf-shadow: 0 10px 28px -8px rgba(15, 23, 42, 0.16);
139
- --ylf-shadow-lg: 0 22px 56px -14px rgba(15, 23, 42, 0.22);
140
- --ylf-shadow-control:
141
- inset 0 1px 0 var(--ylf-c-highlight), 0 1px 2px rgba(15, 23, 42, 0.06), 0 3px 6px -4px rgba(15, 23, 42, 0.16);
142
- --ylf-shadow-inset: inset 0 1px 3px rgba(15, 23, 42, 0.08);
143
- --ylf-shadow-panel:
144
- inset 0 1px 0 var(--ylf-c-highlight), 0 0 0 1px var(--ylf-c-edge), 0 8px 16px -8px rgba(15, 23, 42, 0.14),
145
- 0 28px 64px -20px rgba(24, 52, 102, 0.24);
146
- // 旧阴影名保留别名,新组件使用表面阴影
147
- --ylf-glow-brand: 0 6px 18px -8px rgba(37, 99, 235, 0.35);
148
- --ylf-glow-brand-hover: 0 8px 22px -8px rgba(37, 99, 235, 0.4);
149
- --ylf-glow-aurora: var(--ylf-shadow-sm);
150
- --ylf-glow-aurora-hover: var(--ylf-shadow-sm);
151
-
152
- // --- typography -------------------------------------------------------------
153
- // 圆体做展示字,呼应「云是软的」:拉丁 Baloo 2 + 中文 ZCOOL KuaiLe 站酷快乐体
154
- // (Google Fonts / OFL,圆润活泼)。Baloo 2 无中文字形,故中文需要补一款圆体 display。
155
- // 逐字回退 (per-glyph fallback):
156
- // 拉丁 / 数字 → Baloo 2
157
- // 中文 → ZCOOL KuaiLe(需加载,仅 display 角色)
158
- // → ui-rounded / 丸ゴシック(系统圆体兜底)
159
- // → 苹方 / 雅黑(非圆体系统中文,最终兜底)→ sans-serif
160
- // 字体加载见 ./fonts.scss 或文档 /guide/typography;正文请用 --ylf-font-body(零 webfont)。
161
- --ylf-font-display:
162
- 'Baloo 2', 'ZCOOL KuaiLe', ui-rounded, 'Hiragino Maru Gothic ProN', 'Hiragino Maru Gothic Pro', 'PingFang SC',
163
- 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', 'Source Han Sans SC', sans-serif;
164
- // 品牌字 wordmark(如「云乐坊」):目前等同 display,独立 token 便于单独调校字重/字距
165
- --ylf-font-wordmark: var(--ylf-font-display);
166
- // 产品标题:页面、区块与卡片标题默认使用系统圆润无衬线,不触发 webfont 下载
167
- // 与 display 分开,避免站酷快乐体、楷体等装饰字体进入密集产品界面。
168
- --ylf-font-heading:
169
- ui-rounded, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', 'Source Han Sans SC', system-ui,
170
- sans-serif;
171
- --ylf-font-body: 'Inter', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
172
-
173
- // --- scale:字号、间距与阅读宽度 --------------------------------------------
174
- --ylf-font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
175
- --ylf-text-xs: 0.75rem;
176
- --ylf-text-sm: 0.875rem;
177
- --ylf-text-base: 1rem;
178
- --ylf-text-lg: 1.25rem;
179
- --ylf-text-xl: 1.5rem;
180
- --ylf-text-2xl: 2rem;
181
- --ylf-text-display: clamp(2.25rem, 4.5vw, 4rem);
182
- --ylf-leading-heading: 1.25;
183
- --ylf-leading-body: 1.75;
184
- --ylf-space-1: 4px;
185
- --ylf-space-2: 8px;
186
- --ylf-space-3: 12px;
187
- --ylf-space-4: 16px;
188
- --ylf-space-6: 24px;
189
- --ylf-space-8: 32px;
190
- --ylf-space-12: 48px;
191
- --ylf-space-16: 64px;
192
- --ylf-layout-page: 1200px;
193
- --ylf-layout-reading: 720px;
194
-
195
- // --- atmosphere:可选网格与晴空背景,不自动应用到业务页面 --------------------
196
- --ylf-grid-size: 32px;
197
- --ylf-c-grid: rgba(37, 99, 235, 0.06);
198
- --ylf-c-sky: #dbeafe;
199
- --ylf-c-cloud: #ffffff;
200
-
201
- // --- transition -------------------------------------------------------------
202
- --ylf-duration-fast: 160ms;
203
- --ylf-duration-normal: 240ms;
204
- --ylf-ease-standard: cubic-bezier(0.2, 0, 0, 1);
205
- --ylf-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
206
-
207
- // --- 向后兼容别名(旧组件仍在用) -------------------------------------------
208
- --ylf-c-primary: var(--ylf-c-brand);
209
- --ylf-c-text-light: var(--ylf-c-text-2);
210
- --ylf-c-text-lighter: var(--ylf-c-text-3);
211
- --ylf-c-text-lightest: var(--ylf-c-border-strong);
212
- --ylf-c-bg-light: var(--ylf-c-bg-soft);
213
- --ylf-c-bg-lighter: var(--ylf-c-bg-mute);
214
- }
215
-
216
- .dark,
217
- .ylf-theme-dark {
218
- --ylf-c-brand: #60a5fa;
219
- --ylf-c-brand-hover: #93c5fd;
220
- --ylf-c-brand-active: #3b82f6;
221
- --ylf-c-brand-soft: #172554;
222
242
 
223
- @include brand-accent;
224
-
225
- --ylf-accent-sun-soft: #30290f;
226
- --ylf-accent-sun-text: #fde047;
227
- --ylf-accent-cyan-soft: #10313d;
228
- --ylf-accent-cyan-text: #67e8f9;
229
- --ylf-accent-coral-soft: #39231f;
230
- --ylf-accent-coral-text: #fda48c;
231
- --ylf-accent-pink-soft: #351e32;
232
- --ylf-accent-pink-text: #f9a8d4;
233
- --ylf-accent-green-soft: #142e26;
234
- --ylf-accent-green-text: #86efac;
243
+ .dark,
244
+ .ylf-theme-dark {
245
+ --ylf-c-brand: #60a5fa;
246
+ --ylf-c-brand-hover: #93c5fd;
247
+ --ylf-c-brand-active: #3b82f6;
248
+ --ylf-c-brand-soft: #15264a;
249
+ --ylf-accent-blue: var(--ylf-c-brand);
250
+ --ylf-accent-blue-hover: var(--ylf-c-brand-hover);
251
+ --ylf-accent-blue-soft: var(--ylf-c-brand-soft);
252
+ --ylf-accent-blue-text: var(--ylf-c-brand);
253
+ --ylf-accent-blue-on: var(--ylf-c-text-on-accent);
254
+ --ylf-accent: var(--ylf-accent-blue);
255
+ --ylf-accent-hover: var(--ylf-accent-blue-hover);
256
+ --ylf-accent-soft: var(--ylf-accent-blue-soft);
257
+ --ylf-accent-text: var(--ylf-accent-blue-text);
258
+ --ylf-accent-on: var(--ylf-accent-blue-on);
259
+ --ylf-accent-sun-soft: #30290f;
260
+ --ylf-accent-sun-text: #fde047;
261
+ --ylf-accent-cyan-soft: #10313d;
262
+ --ylf-accent-cyan-text: #67e8f9;
263
+ --ylf-accent-coral-soft: #39231f;
264
+ --ylf-accent-coral-text: #fda48c;
265
+ --ylf-accent-pink-soft: #351e32;
266
+ --ylf-accent-pink-text: #f9a8d4;
267
+ --ylf-accent-green-soft: #142e26;
268
+ --ylf-accent-green-text: #86efac;
269
+ --ylf-status-success: var(--ylf-accent-green);
270
+ --ylf-status-success-hover: var(--ylf-accent-green-hover);
271
+ --ylf-status-success-on: var(--ylf-accent-green-on);
272
+ --ylf-status-success-soft: var(--ylf-accent-green-soft);
273
+ --ylf-status-success-text: var(--ylf-accent-green-text);
274
+ --ylf-status-warning: var(--ylf-accent-sun);
275
+ --ylf-status-warning-hover: var(--ylf-accent-sun-hover);
276
+ --ylf-status-warning-on: var(--ylf-accent-sun-on);
277
+ --ylf-status-warning-soft: var(--ylf-accent-sun-soft);
278
+ --ylf-status-warning-text: var(--ylf-accent-sun-text);
279
+ --ylf-status-danger: var(--ylf-accent-coral);
280
+ --ylf-status-danger-hover: var(--ylf-accent-coral-hover);
281
+ --ylf-status-danger-on: var(--ylf-accent-coral-on);
282
+ --ylf-status-danger-soft: var(--ylf-accent-coral-soft);
283
+ --ylf-status-danger-text: var(--ylf-accent-coral-text);
284
+ --ylf-status-info: var(--ylf-accent-cyan);
285
+ --ylf-status-info-hover: var(--ylf-accent-cyan-hover);
286
+ --ylf-status-info-on: var(--ylf-accent-cyan-on);
287
+ --ylf-status-info-soft: var(--ylf-accent-cyan-soft);
288
+ --ylf-status-info-text: var(--ylf-accent-cyan-text);
289
+ --ylf-c-feature-bg: var(--ylf-accent-sun-soft);
290
+ --ylf-c-feature-text: var(--ylf-c-text);
291
+ --ylf-c-text-on-accent: #0f172a;
292
+ --ylf-c-bg-mute: #22304a;
293
+ --ylf-c-panel: rgba(20, 29, 43, 0.96);
294
+ --ylf-c-highlight: rgba(186, 214, 255, 0.1);
295
+ --ylf-c-edge: rgba(2, 6, 15, 0.55);
296
+ --ylf-c-overlay: rgba(2, 6, 15, 0.72);
297
+ --ylf-ring-color: var(--ylf-c-brand);
298
+ --ylf-glass-bg: rgba(20, 29, 43, 0.9);
299
+ --ylf-glass-border: rgba(96, 165, 250, 0.18);
300
+ --ylf-shadow-sm: 0 2px 10px -2px rgba(2, 6, 15, 0.55);
301
+ --ylf-shadow: 0 12px 30px -8px rgba(2, 6, 15, 0.6);
302
+ --ylf-shadow-lg: 0 24px 60px -14px rgba(2, 6, 15, 0.65);
303
+ --ylf-shadow-control:
304
+ inset 0 1px 0 var(--ylf-c-highlight), 0 1px 2px rgba(2, 6, 15, 0.3), 0 4px 8px -4px rgba(2, 6, 15, 0.35);
305
+ --ylf-shadow-inset: inset 0 1px 4px rgba(2, 6, 15, 0.4);
306
+ --ylf-shadow-panel:
307
+ inset 0 1px 0 var(--ylf-c-highlight), 0 0 0 1px var(--ylf-c-edge), 0 10px 20px -8px rgba(2, 6, 15, 0.4),
308
+ 0 32px 72px -18px rgba(2, 6, 15, 0.6);
309
+ --ylf-glow-brand: 0 6px 18px -8px rgba(96, 165, 250, 0.3);
310
+ --ylf-glow-brand-hover: 0 8px 22px -8px rgba(96, 165, 250, 0.4);
311
+ --ylf-c-bg: #0b111c;
312
+ --ylf-c-bg-soft: #101826;
313
+ --ylf-c-surface: #141d2b;
314
+ --ylf-c-surface-raised: #1b2638;
315
+ --ylf-c-surface-inset: #080d16;
316
+ --ylf-c-text: #e7eef8;
317
+ --ylf-c-text-2: #b9c6d9;
318
+ --ylf-c-text-3: #8d9db4;
319
+ --ylf-c-placeholder: var(--ylf-c-text-3);
320
+ --ylf-c-border: #24324a;
321
+ --ylf-c-border-strong: #36486a;
322
+ --ylf-c-grid: rgba(96, 165, 250, 0.08);
323
+ --ylf-c-sky: #13233a;
324
+ --ylf-c-cloud: #22304a;
325
+ --ylf-cloud-highlight: #a6bcd8;
326
+ --ylf-cloud-body: #3e5679;
327
+ --ylf-cloud-shade: #1c2b44;
328
+ --ylf-cloud-shadow: #0a1424;
329
+ --ylf-cloud-rim: #cfdff2;
330
+ --ylf-cloud-face: #0e1a2d;
331
+ --ylf-cloud-haze-color: #1f3354;
332
+ }
235
333
 
236
- @include status-colors;
334
+ @media (prefers-reduced-motion: reduce) {
335
+ :root,
336
+ .light,
337
+ .dark,
338
+ .ylf-theme-light,
339
+ .ylf-theme-dark {
340
+ --ylf-duration-press: 0ms;
341
+ --ylf-duration-enter: 0ms;
342
+ --ylf-duration-exit: 0ms;
343
+ --ylf-press-scale: 1;
344
+ --ylf-hover-lift: 0px;
345
+ --ylf-duration-fast: 0ms;
346
+ --ylf-duration-normal: 0ms;
347
+ --ylf-duration-slow: 0ms;
348
+ }
349
+ }
237
350
 
238
- // 在局部夜空预览中也重新解析派生变量。
239
- --ylf-c-feature-bg: var(--ylf-accent-sun-soft);
240
- --ylf-c-feature-text: var(--ylf-c-text);
241
- --ylf-gradient-brand: linear-gradient(var(--ylf-c-brand), var(--ylf-c-brand));
351
+ [data-ylf-tone='blue'] {
352
+ --ylf-accent-blue: var(--ylf-c-brand);
353
+ --ylf-accent-blue-hover: var(--ylf-c-brand-hover);
354
+ --ylf-accent-blue-soft: var(--ylf-c-brand-soft);
355
+ --ylf-accent-blue-text: var(--ylf-c-brand);
356
+ --ylf-accent-blue-on: var(--ylf-c-text-on-accent);
357
+ --ylf-accent: var(--ylf-accent-blue);
358
+ --ylf-accent-hover: var(--ylf-accent-blue-hover);
359
+ --ylf-accent-soft: var(--ylf-accent-blue-soft);
360
+ --ylf-accent-text: var(--ylf-accent-blue-text);
361
+ --ylf-accent-on: var(--ylf-accent-blue-on);
362
+ }
242
363
 
243
- // 夜空背景降低蓝色饱和度,明度阶梯与鲜明的品牌色分别维护。
244
- --ylf-c-bg: #10151d;
245
- --ylf-c-bg-soft: #161e28;
246
- --ylf-c-bg-mute: #283545;
247
- --ylf-c-surface: #18212d;
248
- --ylf-c-surface-raised: #202c3a;
249
- --ylf-c-surface-inset: #0e141c;
250
- --ylf-c-highlight: rgba(192, 218, 255, 0.12);
251
- --ylf-c-panel: rgba(24, 33, 45, 0.96);
252
- --ylf-c-edge: rgba(3, 6, 18, 0.5);
364
+ [data-ylf-tone='sun'] {
365
+ --ylf-accent: var(--ylf-accent-sun);
366
+ --ylf-accent-hover: var(--ylf-accent-sun-hover);
367
+ --ylf-accent-soft: var(--ylf-accent-sun-soft);
368
+ --ylf-accent-text: var(--ylf-accent-sun-text);
369
+ --ylf-accent-on: var(--ylf-accent-sun-on);
370
+ }
253
371
 
254
- --ylf-c-text: #e5e7eb;
255
- --ylf-c-text-2: #cbd5e1;
256
- --ylf-c-text-3: #94a3b8;
257
- --ylf-c-text-on-accent: #0f172a;
372
+ [data-ylf-tone='cyan'] {
373
+ --ylf-accent: var(--ylf-accent-cyan);
374
+ --ylf-accent-hover: var(--ylf-accent-cyan-hover);
375
+ --ylf-accent-soft: var(--ylf-accent-cyan-soft);
376
+ --ylf-accent-text: var(--ylf-accent-cyan-text);
377
+ --ylf-accent-on: var(--ylf-accent-cyan-on);
378
+ }
258
379
 
259
- --ylf-c-border: #2d3b4c;
260
- --ylf-c-border-strong: #425367;
261
- --ylf-c-overlay: rgba(3, 6, 18, 0.7);
262
- --ylf-c-grid: rgba(96, 165, 250, 0.08);
263
- --ylf-c-sky: #192b3a;
264
- --ylf-c-cloud: #283545;
380
+ [data-ylf-tone='coral'] {
381
+ --ylf-accent: var(--ylf-accent-coral);
382
+ --ylf-accent-hover: var(--ylf-accent-coral-hover);
383
+ --ylf-accent-soft: var(--ylf-accent-coral-soft);
384
+ --ylf-accent-text: var(--ylf-accent-coral-text);
385
+ --ylf-accent-on: var(--ylf-accent-coral-on);
386
+ }
265
387
 
266
- --ylf-glass-bg: rgba(24, 33, 45, 0.96);
267
- --ylf-glass-border: rgba(96, 165, 250, 0.18);
388
+ [data-ylf-tone='pink'] {
389
+ --ylf-accent: var(--ylf-accent-pink);
390
+ --ylf-accent-hover: var(--ylf-accent-pink-hover);
391
+ --ylf-accent-soft: var(--ylf-accent-pink-soft);
392
+ --ylf-accent-text: var(--ylf-accent-pink-text);
393
+ --ylf-accent-on: var(--ylf-accent-pink-on);
394
+ }
268
395
 
269
- --ylf-shadow-sm: 0 2px 10px -2px rgba(0, 0, 0, 0.5);
270
- --ylf-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.55);
271
- --ylf-shadow-lg: 0 24px 60px -14px rgba(0, 0, 0, 0.6);
272
- --ylf-shadow-control:
273
- inset 0 1px 0 var(--ylf-c-highlight), 0 1px 2px rgba(0, 0, 0, 0.24), 0 4px 8px -4px rgba(0, 0, 0, 0.3);
274
- --ylf-shadow-inset: inset 0 1px 4px rgba(0, 0, 0, 0.35);
275
- --ylf-shadow-panel:
276
- inset 0 1px 0 var(--ylf-c-highlight), 0 0 0 1px var(--ylf-c-edge), 0 10px 20px -8px rgba(0, 0, 0, 0.35),
277
- 0 32px 72px -18px rgba(0, 0, 0, 0.55);
278
- --ylf-glow-brand: 0 6px 18px -8px rgba(96, 165, 250, 0.3);
279
- --ylf-glow-brand-hover: 0 8px 22px -8px rgba(96, 165, 250, 0.4);
280
- --ylf-glow-aurora: var(--ylf-shadow-sm);
281
- --ylf-glow-aurora-hover: var(--ylf-shadow-sm);
396
+ [data-ylf-tone='green'] {
397
+ --ylf-accent: var(--ylf-accent-green);
398
+ --ylf-accent-hover: var(--ylf-accent-green-hover);
399
+ --ylf-accent-soft: var(--ylf-accent-green-soft);
400
+ --ylf-accent-text: var(--ylf-accent-green-text);
401
+ --ylf-accent-on: var(--ylf-accent-green-on);
402
+ }
282
403
  }
283
404
 
284
- @media (prefers-reduced-motion: reduce) {
405
+ @layer ylf.compat {
285
406
  :root,
286
- .ylf-theme-light,
287
- .ylf-theme-dark {
288
- --ylf-duration-fast: 0ms;
289
- --ylf-duration-normal: 0ms;
407
+ .light,
408
+ .ylf-theme-light {
409
+ --ylf-c-success: var(--ylf-status-success-text);
410
+ --ylf-c-warning: var(--ylf-status-warning-text);
411
+ --ylf-c-danger: var(--ylf-status-danger-text);
412
+ --ylf-c-info: var(--ylf-status-info-text);
413
+ --ylf-aurora-sky: var(--ylf-accent-cyan);
414
+ --ylf-aurora-iris: var(--ylf-accent-coral);
415
+ --ylf-aurora-pink: var(--ylf-accent-pink);
416
+ --ylf-gradient-aurora: linear-gradient(var(--ylf-accent-sun), var(--ylf-accent-sun));
417
+ --ylf-gradient-brand: linear-gradient(var(--ylf-c-brand), var(--ylf-c-brand));
418
+ --ylf-c-text-on-aurora: var(--ylf-accent-sun-on);
419
+ --ylf-glow-aurora: var(--ylf-shadow-sm);
420
+ --ylf-glow-aurora-hover: var(--ylf-shadow-sm);
421
+ --ylf-c-primary: var(--ylf-c-brand);
422
+ --ylf-c-text-light: var(--ylf-c-text-2);
423
+ --ylf-c-text-lighter: var(--ylf-c-text-3);
424
+ --ylf-c-text-lightest: var(--ylf-c-border-strong);
425
+ --ylf-c-bg-light: var(--ylf-c-bg-soft);
426
+ --ylf-c-bg-lighter: var(--ylf-c-bg-mute);
290
427
  }
291
- }
292
428
 
293
- // 所有强调组件共用的色彩上下文,也可供原生 HTML 使用。
294
- [data-ylf-tone='blue'] {
295
- @include brand-accent;
296
- }
297
-
298
- [data-ylf-tone='sun'] {
299
- --ylf-accent: var(--ylf-accent-sun);
300
- --ylf-accent-hover: var(--ylf-accent-sun-hover);
301
- --ylf-accent-soft: var(--ylf-accent-sun-soft);
302
- --ylf-accent-text: var(--ylf-accent-sun-text);
303
- --ylf-accent-on: var(--ylf-accent-sun-on);
304
- }
305
-
306
- [data-ylf-tone='cyan'] {
307
- --ylf-accent: var(--ylf-accent-cyan);
308
- --ylf-accent-hover: var(--ylf-accent-cyan-hover);
309
- --ylf-accent-soft: var(--ylf-accent-cyan-soft);
310
- --ylf-accent-text: var(--ylf-accent-cyan-text);
311
- --ylf-accent-on: var(--ylf-accent-cyan-on);
312
- }
313
-
314
- [data-ylf-tone='coral'] {
315
- --ylf-accent: var(--ylf-accent-coral);
316
- --ylf-accent-hover: var(--ylf-accent-coral-hover);
317
- --ylf-accent-soft: var(--ylf-accent-coral-soft);
318
- --ylf-accent-text: var(--ylf-accent-coral-text);
319
- --ylf-accent-on: var(--ylf-accent-coral-on);
320
- }
321
-
322
- [data-ylf-tone='pink'] {
323
- --ylf-accent: var(--ylf-accent-pink);
324
- --ylf-accent-hover: var(--ylf-accent-pink-hover);
325
- --ylf-accent-soft: var(--ylf-accent-pink-soft);
326
- --ylf-accent-text: var(--ylf-accent-pink-text);
327
- --ylf-accent-on: var(--ylf-accent-pink-on);
328
- }
329
-
330
- [data-ylf-tone='green'] {
331
- --ylf-accent: var(--ylf-accent-green);
332
- --ylf-accent-hover: var(--ylf-accent-green-hover);
333
- --ylf-accent-soft: var(--ylf-accent-green-soft);
334
- --ylf-accent-text: var(--ylf-accent-green-text);
335
- --ylf-accent-on: var(--ylf-accent-green-on);
429
+ .dark,
430
+ .ylf-theme-dark {
431
+ --ylf-c-success: var(--ylf-status-success-text);
432
+ --ylf-c-warning: var(--ylf-status-warning-text);
433
+ --ylf-c-danger: var(--ylf-status-danger-text);
434
+ --ylf-c-info: var(--ylf-status-info-text);
435
+ --ylf-gradient-brand: linear-gradient(var(--ylf-c-brand), var(--ylf-c-brand));
436
+ --ylf-glow-aurora: var(--ylf-shadow-sm);
437
+ --ylf-glow-aurora-hover: var(--ylf-shadow-sm);
438
+ --ylf-c-primary: var(--ylf-c-brand);
439
+ --ylf-c-text-light: var(--ylf-c-text-2);
440
+ --ylf-c-text-lighter: var(--ylf-c-text-3);
441
+ --ylf-c-text-lightest: var(--ylf-c-border-strong);
442
+ --ylf-c-bg-light: var(--ylf-c-bg-soft);
443
+ --ylf-c-bg-lighter: var(--ylf-c-bg-mute);
444
+ }
336
445
  }