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
+5 -5
View File
@@ -120,12 +120,12 @@ export default function TextMode({ onSwitchToImageMode }: TextModeProps = {}) {
/>
{showImageHint && (
<div className="flex items-center justify-between p-3 rounded-lg bg-blue-50 border border-blue-200">
<span className="text-sm text-blue-700">{t('imageDataUriHint')}</span>
<div className="flex items-center justify-between p-3 rounded-lg bg-primary/10 border border-primary/30">
<span className="text-sm text-primary">{t('imageDataUriHint')}</span>
<button
type="button"
onClick={onSwitchToImageMode}
className="px-3 py-1 text-sm font-medium text-blue-600 hover:bg-blue-100 rounded-md transition-colors"
className="px-3 py-1 text-sm font-medium text-primary hover:bg-blue-100 rounded-md transition-colors"
>
{t('switchToImageMode')}
</button>
@@ -133,9 +133,9 @@ export default function TextMode({ onSwitchToImageMode }: TextModeProps = {}) {
)}
{output && (
<div className="p-4 rounded-xl bg-blue-50 border border-blue-200">
<div className="p-4 rounded-xl bg-primary/10 border border-primary/30">
<div className="flex justify-between items-center mb-2">
<span className="text-xs font-bold text-gray-500">{outputLabel}</span>
<span className="text-xs font-bold text-muted-foreground">{outputLabel}</span>
<CopyButton text={output} />
</div>
<TextInputArea