From 39eb29d54ec8b65f9520d67833c8856bb80beba1 Mon Sep 17 00:00:00 2001 From: MT-Mint <798521692@qq.com> Date: Mon, 15 Jun 2026 09:26:30 +0800 Subject: [PATCH] =?UTF-8?q?fix(brand):=20=E4=BF=AE=E5=A4=8D=E5=93=81?= =?UTF-8?q?=E7=89=8C=E6=A0=B9=E9=80=89=E6=8B=A9=E5=99=A8=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E8=A6=86=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将品牌类选择器调整为 :root.brand-*,确保品牌变量能够稳定覆盖默认 :root 变量。\n补充品牌选择器测试,校验品牌块中包含 surface elevated 颜色变量。 --- frontend/src/styles/globals-brand-selectors.test.ts | 2 ++ frontend/src/styles/globals.css | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/src/styles/globals-brand-selectors.test.ts b/frontend/src/styles/globals-brand-selectors.test.ts index f2a1da3e..c43ca64c 100644 --- a/frontend/src/styles/globals-brand-selectors.test.ts +++ b/frontend/src/styles/globals-brand-selectors.test.ts @@ -10,4 +10,6 @@ const globalsCss = readFileSync(path.join(currentDir, "globals.css"), "utf8"); void test("brand selectors target :root to outrank default root variables", () => { assert.match(globalsCss, /:root\.brand-xclaw\s*\{/); assert.match(globalsCss, /:root\.brand-sxwz\s*\{/); + assert.match(globalsCss, /:root\.brand-xclaw\s*\{[\s\S]*--ws-color-surface-elevated\s*:/); + assert.match(globalsCss, /:root\.brand-sxwz\s*\{[\s\S]*--ws-color-surface-elevated\s*:/); }); diff --git a/frontend/src/styles/globals.css b/frontend/src/styles/globals.css index b1fe575e..e4e1fae3 100644 --- a/frontend/src/styles/globals.css +++ b/frontend/src/styles/globals.css @@ -68,16 +68,18 @@ @source inline("bg-{background,muted,primary,secondary,accent}"); @source inline("border-{border,input}"); -.brand-xclaw { +:root.brand-xclaw { --brand-color-primary: #150033; --brand-color-primary-10: #1500331a; --brand-color-primary-60: #15003399; + --ws-color-surface-elevated: #fbfafc; } -.brand-sxwz { +:root.brand-sxwz { --brand-color-primary: #000f33; --brand-color-primary-10: #000f331a; --brand-color-primary-60: #000f3399; + --ws-color-surface-elevated: #f8f9fa; } @custom-variant dark (&:is(.dark *)); @@ -647,7 +649,7 @@ code { .workspace-code-editor .ͼ4k, .workspace-code-editor .ͼ4s, -.workspace-code-editor .ͼ4q +.workspace-code-editor .ͼ4q, .workspace-code-editor .ͼ4r { color: var(--ws-color-fg-primary); }