polish(frontend): 侧栏与徽章可读性,智能悬停提示
降权全站字重;优化右栏公告/数据块;类型状态徽章用固定浅色区分;TipHost 仅在文案不一致、非文字或省略时显示。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -59,3 +59,31 @@ export function typeStatusLabel(postType?: string, typeStatus?: string): string
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/** 状态徽章 CSS class(浅色区分) */
|
||||
export function typeStatusClass(postType?: string, typeStatus?: string): string {
|
||||
const pt = normalizePostType(postType);
|
||||
const s = (typeStatus || "").toLowerCase();
|
||||
let kind = "open";
|
||||
switch (pt) {
|
||||
case "question":
|
||||
kind = s === "solved" ? "solved" : "unsolved";
|
||||
break;
|
||||
case "poll":
|
||||
kind = s === "closed" ? "closed" : "open";
|
||||
break;
|
||||
case "bounty":
|
||||
if (s === "solved") kind = "solved";
|
||||
else if (s === "expired") kind = "expired";
|
||||
else kind = "open";
|
||||
break;
|
||||
case "lottery":
|
||||
if (s === "drawn") kind = "drawn";
|
||||
else if (s === "closed") kind = "closed";
|
||||
else kind = "open";
|
||||
break;
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
return `badge-status badge-status-${kind}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user