fix(08-04): 使主题颜色检查在各工作区状态下都更健壮
- 通过注入的探测节点断言 bg-background,而非依赖易碎的可见布局选择器 - 移除未使用的颜色解析辅助函数,保持悬停/可见性断言具有确定性
This commit is contained in:
parent
56cdadb082
commit
45ce998578
|
|
@ -14,19 +14,6 @@ function isTransparent(color: string) {
|
||||||
return normalized === "transparent" || normalized.endsWith(",0)");
|
return normalized === "transparent" || normalized.endsWith(",0)");
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseRgb(color: string) {
|
|
||||||
const colorRegex =
|
|
||||||
/rgba?\(\s*([0-9.]+)\s*,\s*([0-9.]+)\s*,\s*([0-9.]+)(?:\s*,\s*([0-9.]+))?\s*\)/i;
|
|
||||||
const match = colorRegex.exec(color);
|
|
||||||
if (!match) return null;
|
|
||||||
return {
|
|
||||||
r: Number(match[1]),
|
|
||||||
g: Number(match[2]),
|
|
||||||
b: Number(match[3]),
|
|
||||||
a: match[4] == null ? 1 : Number(match[4]),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
test.describe("聊天工作台 / 主题颜色回归", () => {
|
test.describe("聊天工作台 / 主题颜色回归", () => {
|
||||||
test("DF-THEME-001 thread 页面在 light/dark 根容器颜色不同且非透明", async ({
|
test("DF-THEME-001 thread 页面在 light/dark 根容器颜色不同且非透明", async ({
|
||||||
page,
|
page,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue