fix: 修复暗黑模式样式兼容性

- 在 tailwind.config.js 中启用 darkMode: 'class' 并扩展语义化颜色变量
- 将全项目硬编码颜色(bg-white、text-gray-*、border-gray-* 等)替换为语义化类名
- 修复 popup/index.html 硬编码浅色背景色
- 同步更新相关单元测试中的类名断言
This commit is contained in:
雨霖铃
2026-05-22 16:04:50 +08:00
parent 5b9a0f59d3
commit de7da9f1db
42 changed files with 274 additions and 261 deletions
+9 -7
View File
@@ -120,17 +120,17 @@ export default function JsonConvertSection({
{/* 转换结果 */}
{result && result.output ? (
<div className="relative rounded-lg bg-white border border-gray-200 overflow-hidden">
<div className="relative rounded-lg bg-background border border-border overflow-hidden">
{/* 结果头部 */}
<div className="flex justify-between items-center px-4 py-2 border-b border-gray-200 bg-gray-50">
<div className="flex justify-between items-center px-4 py-2 border-b border-border bg-muted">
<div className="flex gap-4 items-center">
<span className="text-[11px] font-extrabold text-gray-500">
<span className="text-[11px] font-extrabold text-muted-foreground">
{t(`jsonFormat:${pk}OutputLabel`)}
</span>
<span className="text-[10px] text-gray-400">
<span className="text-[10px] text-muted-foreground">
{t('jsonFormat:originalSize')}: {formatByteSize(result.originalBytes)}
</span>
<span className="text-[10px] text-gray-400">
<span className="text-[10px] text-muted-foreground">
{t('jsonFormat:formattedSize')}: {formatByteSize(result.outputBytes)}
</span>
</div>
@@ -143,8 +143,10 @@ export default function JsonConvertSection({
</div>
</div>
) : (
<div className="p-4 rounded-lg bg-gray-50 border border-dashed border-gray-300 text-center">
<p className="text-sm font-semibold text-gray-500">{t(`jsonFormat:${pk}EmptyHint`)}</p>
<div className="p-4 rounded-lg bg-muted border border-dashed border-input text-center">
<p className="text-sm font-semibold text-muted-foreground">
{t(`jsonFormat:${pk}EmptyHint`)}
</p>
</div>
)}
</div>