From f396a5545cd7ef29968321429eb1628bf7046b7d Mon Sep 17 00:00:00 2001 From: HIsheR Date: Mon, 26 Oct 2026 21:55:27 +0800 Subject: [PATCH] =?UTF-8?q?iter(g243):=20=E6=96=87=E6=A1=A3=E7=AB=99?= =?UTF-8?q?=E4=B8=8E=E6=BC=94=E7=A4=BA=E9=A1=B5=E5=A4=96=E5=A3=B3=E9=85=8D?= =?UTF-8?q?=E8=89=B2=E6=94=B9=E4=B8=BA=E4=BB=8E=E4=BB=A4=E7=89=8C=E6=B4=BE?= =?UTF-8?q?=E7=94=9F=EF=BC=8C=E6=B6=88=E9=99=A4=E6=9A=97=E8=89=B2=E5=BC=BA?= =?UTF-8?q?=E8=B0=83=E8=89=B2=E6=BC=82=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/demo/build.mjs | 8 +++++-- packages/design/tokens/tokens.css | 4 ++-- packages/tools/cli/bin/ua.js | 10 ++++++--- packages/tools/cli/lib/shell-palette.mjs | 28 ++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 7 deletions(-) create mode 100644 packages/tools/cli/lib/shell-palette.mjs diff --git a/apps/demo/build.mjs b/apps/demo/build.mjs index 9fd7eaf..78d3fe9 100644 --- a/apps/demo/build.mjs +++ b/apps/demo/build.mjs @@ -6,6 +6,7 @@ import fs from 'node:fs'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; import { createRequire } from 'node:module'; +import { shellPalette } from '../../packages/tools/cli/lib/shell-palette.mjs'; // 外壳配色与文档站同源:从 tokens.json 派生 const __dirname = path.dirname(fileURLToPath(import.meta.url)); const root = path.resolve(__dirname, '..', '..'); // apps/demo 上两级 = 仓库根 @@ -34,6 +35,9 @@ const result = await esbuild.build({ const js = result.outputFiles[0].text.replace(/<\/script>/gi, '<\\/script>'); // 防提前闭合 const css = [read('packages/design/tokens/tokens.css'), read('packages/skin/ui/ui.css')].join('\n'); +// 外壳 chrome 配色从 tokens.json 派生:手写值时改暗色 accent 会让页面外壳与组件各显示一种蓝 +const tokensPath = path.join(root, 'packages/design/tokens/tokens.json'); +const shell = shellPalette(fs.existsSync(tokensPath) ? JSON.parse(fs.readFileSync(tokensPath, 'utf8')) : null); const html = ` @@ -43,8 +47,8 @@ const html = ` @ui-arch 组件库 · 现场演示