@yunlefun/ui 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -0
- package/dist/patterns.css +1 -0
- package/package.json +27 -5
- package/styles/css-vars.scss +303 -24
- package/styles/fonts.scss +38 -0
- package/styles/index.scss +4 -0
- package/styles/patterns.scss +13 -0
package/dist/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root,.ylf-theme-light{--ylf-c-brand: var(--ylf-palette-blue);--ylf-c-brand-hover: #1d4ed8;--ylf-c-brand-active: #1e40af;--ylf-c-brand-soft: #eff6ff;--ylf-accent-blue: var(--ylf-c-brand);--ylf-accent-blue-hover: var(--ylf-c-brand-hover);--ylf-accent-blue-soft: var(--ylf-c-brand-soft);--ylf-accent-blue-text: var(--ylf-c-brand);--ylf-accent-blue-on: var(--ylf-c-text-on-accent);--ylf-accent: var(--ylf-accent-blue);--ylf-accent-hover: var(--ylf-accent-blue-hover);--ylf-accent-soft: var(--ylf-accent-blue-soft);--ylf-accent-text: var(--ylf-accent-blue-text);--ylf-accent-on: var(--ylf-accent-blue-on);--ylf-palette-blue: #2563eb;--ylf-palette-sun: #facc15;--ylf-palette-cyan: #06b6d4;--ylf-palette-coral: #ff6b4a;--ylf-palette-pink: #ec4899;--ylf-palette-green: #22c55e;--ylf-spectrum-stops: var(--ylf-palette-blue) 0% 16.667%, var(--ylf-palette-cyan) 16.667% 33.333%, var(--ylf-palette-green) 33.333% 50%, var(--ylf-palette-sun) 50% 66.667%, var(--ylf-palette-coral) 66.667% 83.333%, var(--ylf-palette-pink) 83.333% 100%;--ylf-accent-sun: var(--ylf-palette-sun);--ylf-accent-sun-hover: #eab308;--ylf-accent-sun-soft: #fef9c3;--ylf-accent-sun-text: #854d0e;--ylf-accent-sun-on: #64380e;--ylf-accent-cyan: var(--ylf-palette-cyan);--ylf-accent-cyan-hover: #22d3ee;--ylf-accent-cyan-soft: #cffafe;--ylf-accent-cyan-text: #155e75;--ylf-accent-cyan-on: #083e4f;--ylf-accent-coral: var(--ylf-palette-coral);--ylf-accent-coral-hover: #ff856b;--ylf-accent-coral-soft: #ffede6;--ylf-accent-coral-text: #9a3412;--ylf-accent-coral-on: #551b0a;--ylf-accent-pink: var(--ylf-palette-pink);--ylf-accent-pink-hover: #f472b6;--ylf-accent-pink-soft: #fce7f3;--ylf-accent-pink-text: #9d174d;--ylf-accent-pink-on: #400a2b;--ylf-accent-green: var(--ylf-palette-green);--ylf-accent-green-hover: #4ade80;--ylf-accent-green-soft: #dcfce7;--ylf-accent-green-text: #166534;--ylf-accent-green-on: #124324;--ylf-c-feature: var(--ylf-accent-sun);--ylf-c-feature-bg: var(--ylf-accent-sun-soft);--ylf-c-feature-text: var(--ylf-c-text);--ylf-aurora-sky: var(--ylf-accent-cyan);--ylf-aurora-iris: var(--ylf-accent-coral);--ylf-aurora-pink: var(--ylf-accent-pink);--ylf-gradient-aurora: linear-gradient(var(--ylf-accent-sun), var(--ylf-accent-sun));--ylf-gradient-brand: linear-gradient(var(--ylf-c-brand), var(--ylf-c-brand));--ylf-status-success: var(--ylf-accent-green);--ylf-status-success-hover: var(--ylf-accent-green-hover);--ylf-status-success-on: var(--ylf-accent-green-on);--ylf-status-success-soft: var(--ylf-accent-green-soft);--ylf-status-success-text: var(--ylf-accent-green-text);--ylf-c-success: var(--ylf-status-success-text);--ylf-status-warning: var(--ylf-accent-sun);--ylf-status-warning-hover: var(--ylf-accent-sun-hover);--ylf-status-warning-on: var(--ylf-accent-sun-on);--ylf-status-warning-soft: var(--ylf-accent-sun-soft);--ylf-status-warning-text: var(--ylf-accent-sun-text);--ylf-c-warning: var(--ylf-status-warning-text);--ylf-status-danger: var(--ylf-accent-coral);--ylf-status-danger-hover: var(--ylf-accent-coral-hover);--ylf-status-danger-on: var(--ylf-accent-coral-on);--ylf-status-danger-soft: var(--ylf-accent-coral-soft);--ylf-status-danger-text: var(--ylf-accent-coral-text);--ylf-c-danger: var(--ylf-status-danger-text);--ylf-status-info: var(--ylf-accent-cyan);--ylf-status-info-hover: var(--ylf-accent-cyan-hover);--ylf-status-info-on: var(--ylf-accent-cyan-on);--ylf-status-info-soft: var(--ylf-accent-cyan-soft);--ylf-status-info-text: var(--ylf-accent-cyan-text);--ylf-c-info: var(--ylf-status-info-text);--ylf-c-bg: #f8fafc;--ylf-c-bg-soft: #f1f5f9;--ylf-c-bg-mute: #e2e8f0;--ylf-c-surface: #ffffff;--ylf-c-text: #0f172a;--ylf-c-text-2: #475569;--ylf-c-text-3: #64748b;--ylf-c-text-on-accent: #ffffff;--ylf-c-text-on-aurora: var(--ylf-accent-sun-on);--ylf-c-border: #e2e8f0;--ylf-c-border-strong: #cbd5e1;--ylf-c-overlay: rgba(13, 17, 32, 0.45);--ylf-glass-bg: rgba(255, 255, 255, 0.62);--ylf-glass-border: rgba(255, 255, 255, 0.7);--ylf-glass-blur: saturate(160%) blur(16px);--ylf-radius-sm: 10px;--ylf-radius: 14px;--ylf-radius-lg: 20px;--ylf-radius-xl: 28px;--ylf-radius-pill: 999px;--ylf-shadow-sm: 0 2px 8px -2px rgba(15, 23, 42, 0.12);--ylf-shadow: 0 10px 28px -8px rgba(15, 23, 42, 0.16);--ylf-shadow-lg: 0 22px 56px -14px rgba(15, 23, 42, 0.22);--ylf-glow-brand: 0 6px 18px -8px rgba(37, 99, 235, 0.35);--ylf-glow-brand-hover: 0 8px 22px -8px rgba(37, 99, 235, 0.4);--ylf-glow-aurora: var(--ylf-shadow-sm);--ylf-glow-aurora-hover: var(--ylf-shadow-sm);--ylf-font-display: 'Baloo 2', 'ZCOOL KuaiLe', ui-rounded, 'Hiragino Maru Gothic ProN', 'Hiragino Maru Gothic Pro', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', 'Source Han Sans SC', sans-serif;--ylf-font-wordmark: var(--ylf-font-display);--ylf-font-heading: ui-rounded, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', 'Source Han Sans SC', system-ui, sans-serif;--ylf-font-body: 'Inter', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;--ylf-font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;--ylf-text-xs: 0.75rem;--ylf-text-sm: 0.875rem;--ylf-text-base: 1rem;--ylf-text-lg: 1.25rem;--ylf-text-xl: 1.5rem;--ylf-text-2xl: 2rem;--ylf-text-display: clamp(2.25rem, 4.5vw, 4rem);--ylf-leading-heading: 1.25;--ylf-leading-body: 1.75;--ylf-space-1: 4px;--ylf-space-2: 8px;--ylf-space-3: 12px;--ylf-space-4: 16px;--ylf-space-6: 24px;--ylf-space-8: 32px;--ylf-space-12: 48px;--ylf-space-16: 64px;--ylf-layout-page: 1200px;--ylf-layout-reading: 720px;--ylf-grid-size: 32px;--ylf-c-grid: rgba(37, 99, 235, 0.06);--ylf-c-sky: #dbeafe;--ylf-c-cloud: #ffffff;--ylf-duration-fast: 160ms;--ylf-duration-normal: 240ms;--ylf-ease-standard: cubic-bezier(0.2, 0, 0, 1);--ylf-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);--ylf-c-primary: var(--ylf-c-brand);--ylf-c-text-light: var(--ylf-c-text-2);--ylf-c-text-lighter: var(--ylf-c-text-3);--ylf-c-text-lightest: var(--ylf-c-border-strong);--ylf-c-bg-light: var(--ylf-c-bg-soft);--ylf-c-bg-lighter: var(--ylf-c-bg-mute)}.dark,.ylf-theme-dark{--ylf-c-brand: #60a5fa;--ylf-c-brand-hover: #93c5fd;--ylf-c-brand-active: #3b82f6;--ylf-c-brand-soft: #172554;--ylf-accent-blue: var(--ylf-c-brand);--ylf-accent-blue-hover: var(--ylf-c-brand-hover);--ylf-accent-blue-soft: var(--ylf-c-brand-soft);--ylf-accent-blue-text: var(--ylf-c-brand);--ylf-accent-blue-on: var(--ylf-c-text-on-accent);--ylf-accent: var(--ylf-accent-blue);--ylf-accent-hover: var(--ylf-accent-blue-hover);--ylf-accent-soft: var(--ylf-accent-blue-soft);--ylf-accent-text: var(--ylf-accent-blue-text);--ylf-accent-on: var(--ylf-accent-blue-on);--ylf-accent-sun-soft: #30290f;--ylf-accent-sun-text: #fde047;--ylf-accent-cyan-soft: #10313d;--ylf-accent-cyan-text: #67e8f9;--ylf-accent-coral-soft: #39231f;--ylf-accent-coral-text: #fda48c;--ylf-accent-pink-soft: #351e32;--ylf-accent-pink-text: #f9a8d4;--ylf-accent-green-soft: #142e26;--ylf-accent-green-text: #86efac;--ylf-status-success: var(--ylf-accent-green);--ylf-status-success-hover: var(--ylf-accent-green-hover);--ylf-status-success-on: var(--ylf-accent-green-on);--ylf-status-success-soft: var(--ylf-accent-green-soft);--ylf-status-success-text: var(--ylf-accent-green-text);--ylf-c-success: var(--ylf-status-success-text);--ylf-status-warning: var(--ylf-accent-sun);--ylf-status-warning-hover: var(--ylf-accent-sun-hover);--ylf-status-warning-on: var(--ylf-accent-sun-on);--ylf-status-warning-soft: var(--ylf-accent-sun-soft);--ylf-status-warning-text: var(--ylf-accent-sun-text);--ylf-c-warning: var(--ylf-status-warning-text);--ylf-status-danger: var(--ylf-accent-coral);--ylf-status-danger-hover: var(--ylf-accent-coral-hover);--ylf-status-danger-on: var(--ylf-accent-coral-on);--ylf-status-danger-soft: var(--ylf-accent-coral-soft);--ylf-status-danger-text: var(--ylf-accent-coral-text);--ylf-c-danger: var(--ylf-status-danger-text);--ylf-status-info: var(--ylf-accent-cyan);--ylf-status-info-hover: var(--ylf-accent-cyan-hover);--ylf-status-info-on: var(--ylf-accent-cyan-on);--ylf-status-info-soft: var(--ylf-accent-cyan-soft);--ylf-status-info-text: var(--ylf-accent-cyan-text);--ylf-c-info: var(--ylf-status-info-text);--ylf-c-feature-bg: var(--ylf-accent-sun-soft);--ylf-c-feature-text: var(--ylf-c-text);--ylf-gradient-brand: linear-gradient(var(--ylf-c-brand), var(--ylf-c-brand));--ylf-c-bg: #0b1022;--ylf-c-bg-soft: #0f1630;--ylf-c-bg-mute: #1f2a47;--ylf-c-surface: #121a30;--ylf-c-text: #e5e7eb;--ylf-c-text-2: #cbd5e1;--ylf-c-text-3: #94a3b8;--ylf-c-text-on-accent: #0f172a;--ylf-c-border: #2a3658;--ylf-c-border-strong: #3c4c74;--ylf-c-overlay: rgba(3, 6, 18, 0.7);--ylf-c-grid: rgba(96, 165, 250, 0.08);--ylf-c-sky: #172554;--ylf-c-cloud: #1f2a47;--ylf-glass-bg: rgba(18, 26, 48, 0.55);--ylf-glass-border: rgba(96, 165, 250, 0.18);--ylf-shadow-sm: 0 2px 10px -2px rgba(0, 0, 0, 0.5);--ylf-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.55);--ylf-shadow-lg: 0 24px 60px -14px rgba(0, 0, 0, 0.6);--ylf-glow-brand: 0 6px 18px -8px rgba(96, 165, 250, 0.3);--ylf-glow-brand-hover: 0 8px 22px -8px rgba(96, 165, 250, 0.4);--ylf-glow-aurora: var(--ylf-shadow-sm);--ylf-glow-aurora-hover: var(--ylf-shadow-sm)}@media(prefers-reduced-motion: reduce){:root,.ylf-theme-light,.ylf-theme-dark{--ylf-duration-fast: 0ms;--ylf-duration-normal: 0ms}}[data-ylf-tone=blue]{--ylf-accent-blue: var(--ylf-c-brand);--ylf-accent-blue-hover: var(--ylf-c-brand-hover);--ylf-accent-blue-soft: var(--ylf-c-brand-soft);--ylf-accent-blue-text: var(--ylf-c-brand);--ylf-accent-blue-on: var(--ylf-c-text-on-accent);--ylf-accent: var(--ylf-accent-blue);--ylf-accent-hover: var(--ylf-accent-blue-hover);--ylf-accent-soft: var(--ylf-accent-blue-soft);--ylf-accent-text: var(--ylf-accent-blue-text);--ylf-accent-on: var(--ylf-accent-blue-on)}[data-ylf-tone=sun]{--ylf-accent: var(--ylf-accent-sun);--ylf-accent-hover: var(--ylf-accent-sun-hover);--ylf-accent-soft: var(--ylf-accent-sun-soft);--ylf-accent-text: var(--ylf-accent-sun-text);--ylf-accent-on: var(--ylf-accent-sun-on)}[data-ylf-tone=cyan]{--ylf-accent: var(--ylf-accent-cyan);--ylf-accent-hover: var(--ylf-accent-cyan-hover);--ylf-accent-soft: var(--ylf-accent-cyan-soft);--ylf-accent-text: var(--ylf-accent-cyan-text);--ylf-accent-on: var(--ylf-accent-cyan-on)}[data-ylf-tone=coral]{--ylf-accent: var(--ylf-accent-coral);--ylf-accent-hover: var(--ylf-accent-coral-hover);--ylf-accent-soft: var(--ylf-accent-coral-soft);--ylf-accent-text: var(--ylf-accent-coral-text);--ylf-accent-on: var(--ylf-accent-coral-on)}[data-ylf-tone=pink]{--ylf-accent: var(--ylf-accent-pink);--ylf-accent-hover: var(--ylf-accent-pink-hover);--ylf-accent-soft: var(--ylf-accent-pink-soft);--ylf-accent-text: var(--ylf-accent-pink-text);--ylf-accent-on: var(--ylf-accent-pink-on)}[data-ylf-tone=green]{--ylf-accent: var(--ylf-accent-green);--ylf-accent-hover: var(--ylf-accent-green-hover);--ylf-accent-soft: var(--ylf-accent-green-soft);--ylf-accent-text: var(--ylf-accent-green-text);--ylf-accent-on: var(--ylf-accent-green-on)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ylf-pattern-grid{background-image:linear-gradient(var(--ylf-c-grid) 1px, transparent 1px),linear-gradient(90deg, var(--ylf-c-grid) 1px, transparent 1px);background-size:var(--ylf-grid-size) var(--ylf-grid-size)}.ylf-pattern-sky{background-color:var(--ylf-c-bg);background-image:linear-gradient(145deg, var(--ylf-c-sky), var(--ylf-c-bg) 70%)}
|
package/package.json
CHANGED
|
@@ -1,20 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yunlefun/ui",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"description": "Shared styles and design tokens for YunLeFun Design",
|
|
5
5
|
"author": "YunLeFun",
|
|
6
6
|
"homepage": "https://ui.yunle.fun",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "https://github.com/YunLeFun/
|
|
9
|
+
"url": "https://github.com/YunLeFun/design.git"
|
|
10
10
|
},
|
|
11
11
|
"keywords": [
|
|
12
12
|
"ui",
|
|
13
13
|
"css"
|
|
14
14
|
],
|
|
15
|
+
"exports": {
|
|
16
|
+
"./css": "./dist/index.css",
|
|
17
|
+
"./patterns.css": "./dist/patterns.css",
|
|
18
|
+
"./styles": "./styles/index.scss",
|
|
19
|
+
"./styles/*": "./styles/*",
|
|
20
|
+
"./*": "./*"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"styles"
|
|
25
|
+
],
|
|
15
26
|
"scripts": {
|
|
16
|
-
"build": "",
|
|
17
|
-
"
|
|
27
|
+
"build": "sass styles/index.scss dist/index.css --no-source-map --style=compressed && sass styles/patterns.scss dist/patterns.css --no-source-map --style=compressed",
|
|
28
|
+
"prepack": "npm run build",
|
|
18
29
|
"release": "bumpp --no-commit --no-tag --no-push && npm publish"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"sass": "^1.101.0"
|
|
33
|
+
},
|
|
34
|
+
"peerDependenciesMeta": {
|
|
35
|
+
"sass": {
|
|
36
|
+
"optional": true
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"sass": "^1.101.0"
|
|
19
41
|
}
|
|
20
42
|
}
|
package/styles/css-vars.scss
CHANGED
|
@@ -1,34 +1,313 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// YunLeFun Design —— 晴空蓝为主,高饱和纯色点缀
|
|
3
|
+
// -----------------------------------------------------------------------------
|
|
4
|
+
// 晴空蓝负责主操作、链接和选中状态;明黄、青、橙、粉、绿用于有明确用途的局部强调。
|
|
5
|
+
// 语义色负责状态,前景与背景成组维护,明暗主题共享相同角色。
|
|
6
|
+
// 组件以 var(--ylf-*) 引用这些 token(均带兜底值),加载本文件即生效。
|
|
7
|
+
// =============================================================================
|
|
8
|
+
|
|
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);
|
|
16
|
+
|
|
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);
|
|
34
|
+
}
|
|
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
|
+
|
|
108
|
+
--ylf-c-text: #0f172a;
|
|
109
|
+
--ylf-c-text-2: #475569;
|
|
110
|
+
--ylf-c-text-3: #64748b;
|
|
111
|
+
--ylf-c-text-on-accent: #ffffff;
|
|
112
|
+
--ylf-c-text-on-aurora: var(--ylf-accent-sun-on);
|
|
113
|
+
|
|
114
|
+
--ylf-c-border: #e2e8f0;
|
|
115
|
+
--ylf-c-border-strong: #cbd5e1;
|
|
116
|
+
--ylf-c-overlay: rgba(13, 17, 32, 0.45);
|
|
117
|
+
|
|
118
|
+
// --- glass 云玻璃 -----------------------------------------------------------
|
|
119
|
+
--ylf-glass-bg: rgba(255, 255, 255, 0.62);
|
|
120
|
+
--ylf-glass-border: rgba(255, 255, 255, 0.7);
|
|
121
|
+
--ylf-glass-blur: saturate(160%) blur(16px);
|
|
122
|
+
|
|
123
|
+
// --- radius 圆角(云是软的) ------------------------------------------------
|
|
124
|
+
--ylf-radius-sm: 10px;
|
|
125
|
+
--ylf-radius: 14px;
|
|
126
|
+
--ylf-radius-lg: 20px;
|
|
127
|
+
--ylf-radius-xl: 28px;
|
|
128
|
+
--ylf-radius-pill: 999px;
|
|
129
|
+
|
|
130
|
+
// --- shadow 色染柔影(投影带品牌色而非灰) ----------------------------------
|
|
131
|
+
--ylf-shadow-sm: 0 2px 8px -2px rgba(15, 23, 42, 0.12);
|
|
132
|
+
--ylf-shadow: 0 10px 28px -8px rgba(15, 23, 42, 0.16);
|
|
133
|
+
--ylf-shadow-lg: 0 22px 56px -14px rgba(15, 23, 42, 0.22);
|
|
134
|
+
// 旧阴影名保留别名,新组件使用表面阴影
|
|
135
|
+
--ylf-glow-brand: 0 6px 18px -8px rgba(37, 99, 235, 0.35);
|
|
136
|
+
--ylf-glow-brand-hover: 0 8px 22px -8px rgba(37, 99, 235, 0.4);
|
|
137
|
+
--ylf-glow-aurora: var(--ylf-shadow-sm);
|
|
138
|
+
--ylf-glow-aurora-hover: var(--ylf-shadow-sm);
|
|
139
|
+
|
|
140
|
+
// --- typography -------------------------------------------------------------
|
|
141
|
+
// 圆体做展示字,呼应「云是软的」:拉丁 Baloo 2 + 中文 ZCOOL KuaiLe 站酷快乐体
|
|
142
|
+
// (Google Fonts / OFL,圆润活泼)。Baloo 2 无中文字形,故中文需要补一款圆体 display。
|
|
143
|
+
// 逐字回退 (per-glyph fallback):
|
|
144
|
+
// 拉丁 / 数字 → Baloo 2
|
|
145
|
+
// 中文 → ZCOOL KuaiLe(需加载,仅 display 角色)
|
|
146
|
+
// → ui-rounded / 丸ゴシック(系统圆体兜底)
|
|
147
|
+
// → 苹方 / 雅黑(非圆体系统中文,最终兜底)→ sans-serif
|
|
148
|
+
// 字体加载见 ./fonts.scss 或文档 /guide/typography;正文请用 --ylf-font-body(零 webfont)。
|
|
149
|
+
--ylf-font-display:
|
|
150
|
+
'Baloo 2', 'ZCOOL KuaiLe', ui-rounded, 'Hiragino Maru Gothic ProN', 'Hiragino Maru Gothic Pro', 'PingFang SC',
|
|
151
|
+
'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', 'Source Han Sans SC', sans-serif;
|
|
152
|
+
// 品牌字 wordmark(如「云乐坊」):目前等同 display,独立 token 便于单独调校字重/字距
|
|
153
|
+
--ylf-font-wordmark: var(--ylf-font-display);
|
|
154
|
+
// 产品标题:页面、区块与卡片标题默认使用系统圆润无衬线,不触发 webfont 下载
|
|
155
|
+
// 与 display 分开,避免站酷快乐体、楷体等装饰字体进入密集产品界面。
|
|
156
|
+
--ylf-font-heading:
|
|
157
|
+
ui-rounded, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', 'Source Han Sans SC', system-ui,
|
|
158
|
+
sans-serif;
|
|
159
|
+
--ylf-font-body: 'Inter', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
|
|
160
|
+
|
|
161
|
+
// --- scale:字号、间距与阅读宽度 --------------------------------------------
|
|
162
|
+
--ylf-font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
|
|
163
|
+
--ylf-text-xs: 0.75rem;
|
|
164
|
+
--ylf-text-sm: 0.875rem;
|
|
165
|
+
--ylf-text-base: 1rem;
|
|
166
|
+
--ylf-text-lg: 1.25rem;
|
|
167
|
+
--ylf-text-xl: 1.5rem;
|
|
168
|
+
--ylf-text-2xl: 2rem;
|
|
169
|
+
--ylf-text-display: clamp(2.25rem, 4.5vw, 4rem);
|
|
170
|
+
--ylf-leading-heading: 1.25;
|
|
171
|
+
--ylf-leading-body: 1.75;
|
|
172
|
+
--ylf-space-1: 4px;
|
|
173
|
+
--ylf-space-2: 8px;
|
|
174
|
+
--ylf-space-3: 12px;
|
|
175
|
+
--ylf-space-4: 16px;
|
|
176
|
+
--ylf-space-6: 24px;
|
|
177
|
+
--ylf-space-8: 32px;
|
|
178
|
+
--ylf-space-12: 48px;
|
|
179
|
+
--ylf-space-16: 64px;
|
|
180
|
+
--ylf-layout-page: 1200px;
|
|
181
|
+
--ylf-layout-reading: 720px;
|
|
182
|
+
|
|
183
|
+
// --- atmosphere:可选网格与晴空背景,不自动应用到业务页面 --------------------
|
|
184
|
+
--ylf-grid-size: 32px;
|
|
185
|
+
--ylf-c-grid: rgba(37, 99, 235, 0.06);
|
|
186
|
+
--ylf-c-sky: #dbeafe;
|
|
187
|
+
--ylf-c-cloud: #ffffff;
|
|
188
|
+
|
|
189
|
+
// --- transition -------------------------------------------------------------
|
|
190
|
+
--ylf-duration-fast: 160ms;
|
|
191
|
+
--ylf-duration-normal: 240ms;
|
|
192
|
+
--ylf-ease-standard: cubic-bezier(0.2, 0, 0, 1);
|
|
193
|
+
--ylf-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
194
|
+
|
|
195
|
+
// --- 向后兼容别名(旧组件仍在用) -------------------------------------------
|
|
196
|
+
--ylf-c-primary: var(--ylf-c-brand);
|
|
197
|
+
--ylf-c-text-light: var(--ylf-c-text-2);
|
|
198
|
+
--ylf-c-text-lighter: var(--ylf-c-text-3);
|
|
199
|
+
--ylf-c-text-lightest: var(--ylf-c-border-strong);
|
|
200
|
+
--ylf-c-bg-light: var(--ylf-c-bg-soft);
|
|
201
|
+
--ylf-c-bg-lighter: var(--ylf-c-bg-mute);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.dark,
|
|
205
|
+
.ylf-theme-dark {
|
|
206
|
+
--ylf-c-brand: #60a5fa;
|
|
207
|
+
--ylf-c-brand-hover: #93c5fd;
|
|
208
|
+
--ylf-c-brand-active: #3b82f6;
|
|
209
|
+
--ylf-c-brand-soft: #172554;
|
|
210
|
+
|
|
211
|
+
@include brand-accent;
|
|
212
|
+
|
|
213
|
+
--ylf-accent-sun-soft: #30290f;
|
|
214
|
+
--ylf-accent-sun-text: #fde047;
|
|
215
|
+
--ylf-accent-cyan-soft: #10313d;
|
|
216
|
+
--ylf-accent-cyan-text: #67e8f9;
|
|
217
|
+
--ylf-accent-coral-soft: #39231f;
|
|
218
|
+
--ylf-accent-coral-text: #fda48c;
|
|
219
|
+
--ylf-accent-pink-soft: #351e32;
|
|
220
|
+
--ylf-accent-pink-text: #f9a8d4;
|
|
221
|
+
--ylf-accent-green-soft: #142e26;
|
|
222
|
+
--ylf-accent-green-text: #86efac;
|
|
223
|
+
|
|
224
|
+
@include status-colors;
|
|
225
|
+
|
|
226
|
+
// 在局部夜空预览中也重新解析派生变量。
|
|
227
|
+
--ylf-c-feature-bg: var(--ylf-accent-sun-soft);
|
|
228
|
+
--ylf-c-feature-text: var(--ylf-c-text);
|
|
229
|
+
--ylf-gradient-brand: linear-gradient(var(--ylf-c-brand), var(--ylf-c-brand));
|
|
230
|
+
|
|
231
|
+
// 深色 = 夜空(不是死黑,是深蓝夜空)
|
|
232
|
+
--ylf-c-bg: #0b1022;
|
|
233
|
+
--ylf-c-bg-soft: #0f1630;
|
|
234
|
+
--ylf-c-bg-mute: #1f2a47;
|
|
235
|
+
--ylf-c-surface: #121a30;
|
|
236
|
+
|
|
237
|
+
--ylf-c-text: #e5e7eb;
|
|
238
|
+
--ylf-c-text-2: #cbd5e1;
|
|
239
|
+
--ylf-c-text-3: #94a3b8;
|
|
240
|
+
--ylf-c-text-on-accent: #0f172a;
|
|
241
|
+
|
|
242
|
+
--ylf-c-border: #2a3658;
|
|
243
|
+
--ylf-c-border-strong: #3c4c74;
|
|
244
|
+
--ylf-c-overlay: rgba(3, 6, 18, 0.7);
|
|
245
|
+
--ylf-c-grid: rgba(96, 165, 250, 0.08);
|
|
246
|
+
--ylf-c-sky: #172554;
|
|
247
|
+
--ylf-c-cloud: #1f2a47;
|
|
248
|
+
|
|
249
|
+
--ylf-glass-bg: rgba(18, 26, 48, 0.55);
|
|
250
|
+
--ylf-glass-border: rgba(96, 165, 250, 0.18);
|
|
251
|
+
|
|
252
|
+
--ylf-shadow-sm: 0 2px 10px -2px rgba(0, 0, 0, 0.5);
|
|
253
|
+
--ylf-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.55);
|
|
254
|
+
--ylf-shadow-lg: 0 24px 60px -14px rgba(0, 0, 0, 0.6);
|
|
255
|
+
--ylf-glow-brand: 0 6px 18px -8px rgba(96, 165, 250, 0.3);
|
|
256
|
+
--ylf-glow-brand-hover: 0 8px 22px -8px rgba(96, 165, 250, 0.4);
|
|
257
|
+
--ylf-glow-aurora: var(--ylf-shadow-sm);
|
|
258
|
+
--ylf-glow-aurora-hover: var(--ylf-shadow-sm);
|
|
4
259
|
}
|
|
5
260
|
|
|
6
|
-
:
|
|
7
|
-
|
|
261
|
+
@media (prefers-reduced-motion: reduce) {
|
|
262
|
+
:root,
|
|
263
|
+
.ylf-theme-light,
|
|
264
|
+
.ylf-theme-dark {
|
|
265
|
+
--ylf-duration-fast: 0ms;
|
|
266
|
+
--ylf-duration-normal: 0ms;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
8
269
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
--ylf-c-bg: #fff;
|
|
15
|
-
--ylf-c-bg-light: #f5f5f5;
|
|
16
|
-
--ylf-c-bg-lighter: #eee;
|
|
270
|
+
// 所有强调组件共用的色彩上下文,也可供原生 HTML 使用。
|
|
271
|
+
[data-ylf-tone='blue'] {
|
|
272
|
+
@include brand-accent;
|
|
273
|
+
}
|
|
17
274
|
|
|
18
|
-
|
|
275
|
+
[data-ylf-tone='sun'] {
|
|
276
|
+
--ylf-accent: var(--ylf-accent-sun);
|
|
277
|
+
--ylf-accent-hover: var(--ylf-accent-sun-hover);
|
|
278
|
+
--ylf-accent-soft: var(--ylf-accent-sun-soft);
|
|
279
|
+
--ylf-accent-text: var(--ylf-accent-sun-text);
|
|
280
|
+
--ylf-accent-on: var(--ylf-accent-sun-on);
|
|
19
281
|
}
|
|
20
282
|
|
|
21
|
-
|
|
22
|
-
--ylf-
|
|
283
|
+
[data-ylf-tone='cyan'] {
|
|
284
|
+
--ylf-accent: var(--ylf-accent-cyan);
|
|
285
|
+
--ylf-accent-hover: var(--ylf-accent-cyan-hover);
|
|
286
|
+
--ylf-accent-soft: var(--ylf-accent-cyan-soft);
|
|
287
|
+
--ylf-accent-text: var(--ylf-accent-cyan-text);
|
|
288
|
+
--ylf-accent-on: var(--ylf-accent-cyan-on);
|
|
289
|
+
}
|
|
23
290
|
|
|
24
|
-
|
|
25
|
-
--ylf-
|
|
26
|
-
--ylf-
|
|
27
|
-
--ylf-
|
|
291
|
+
[data-ylf-tone='coral'] {
|
|
292
|
+
--ylf-accent: var(--ylf-accent-coral);
|
|
293
|
+
--ylf-accent-hover: var(--ylf-accent-coral-hover);
|
|
294
|
+
--ylf-accent-soft: var(--ylf-accent-coral-soft);
|
|
295
|
+
--ylf-accent-text: var(--ylf-accent-coral-text);
|
|
296
|
+
--ylf-accent-on: var(--ylf-accent-coral-on);
|
|
297
|
+
}
|
|
28
298
|
|
|
29
|
-
|
|
30
|
-
--ylf-
|
|
31
|
-
--ylf-
|
|
299
|
+
[data-ylf-tone='pink'] {
|
|
300
|
+
--ylf-accent: var(--ylf-accent-pink);
|
|
301
|
+
--ylf-accent-hover: var(--ylf-accent-pink-hover);
|
|
302
|
+
--ylf-accent-soft: var(--ylf-accent-pink-soft);
|
|
303
|
+
--ylf-accent-text: var(--ylf-accent-pink-text);
|
|
304
|
+
--ylf-accent-on: var(--ylf-accent-pink-on);
|
|
305
|
+
}
|
|
32
306
|
|
|
33
|
-
|
|
307
|
+
[data-ylf-tone='green'] {
|
|
308
|
+
--ylf-accent: var(--ylf-accent-green);
|
|
309
|
+
--ylf-accent-hover: var(--ylf-accent-green-hover);
|
|
310
|
+
--ylf-accent-soft: var(--ylf-accent-green-soft);
|
|
311
|
+
--ylf-accent-text: var(--ylf-accent-green-text);
|
|
312
|
+
--ylf-accent-on: var(--ylf-accent-green-on);
|
|
34
313
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// 云乐坊 · 圆体字体加载(CDN)/ Rounded display webfonts via CDN
|
|
3
|
+
// -----------------------------------------------------------------------------
|
|
4
|
+
// 只为「品牌展示」角色加载圆体;产品标题与正文均走系统字体,零下载。
|
|
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-heading {
|
|
33
|
+
font-family: var(--ylf-font-heading);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.ylf-font-body {
|
|
37
|
+
font-family: var(--ylf-font-body);
|
|
38
|
+
}
|
package/styles/index.scss
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// 可选的品牌背景;先加载 @yunlefun/ui/styles,再按需加载本文件。
|
|
2
|
+
// 装饰不使用定位伪元素,不影响宿主布局或遮挡内容。
|
|
3
|
+
.ylf-pattern-grid {
|
|
4
|
+
background-image:
|
|
5
|
+
linear-gradient(var(--ylf-c-grid) 1px, transparent 1px),
|
|
6
|
+
linear-gradient(90deg, var(--ylf-c-grid) 1px, transparent 1px);
|
|
7
|
+
background-size: var(--ylf-grid-size) var(--ylf-grid-size);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.ylf-pattern-sky {
|
|
11
|
+
background-color: var(--ylf-c-bg);
|
|
12
|
+
background-image: linear-gradient(145deg, var(--ylf-c-sky), var(--ylf-c-bg) 70%);
|
|
13
|
+
}
|