fix: 修复输入框和按钮在暗色模式下的样式问题

- 为 :root 和 .dark 添加 color-scheme,使浏览器表单控件默认样式适配暗色模式
- 将 bg-primary 搭配 text-white 的按钮改为 text-primary-foreground
- 替换残留的 hover:bg-blue-700、text-blue-500、bg-gray-200 等硬编码颜色
- 同步更新 TextInputArea 单元测试
This commit is contained in:
雨霖铃
2026-05-22 17:36:37 +08:00
parent de7da9f1db
commit c7beebf6e0
10 changed files with 25 additions and 18 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ const LiveClock = React.memo(({ unit, onUseNow }: LiveClockProps) => {
<button
onClick={handleUseNow}
title={t('timestamp:useNowTooltip')}
className="p-1.5 rounded-md bg-background text-primary shadow-sm hover:bg-blue-700 hover:text-white transition-colors"
className="p-1.5 rounded-md bg-background text-primary shadow-sm hover:bg-primary hover:text-primary-foreground transition-colors"
>
<Clock className="w-4 h-4" />
</button>
+1 -1
View File
@@ -98,7 +98,7 @@ export default function Index() {
{/* 立即转换 */}
<button
onClick={convert}
className="block mx-auto mt-4 mb-1 max-w-[240px] w-full py-2.5 text-sm font-semibold rounded-lg bg-primary text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 transition-all"
className="block mx-auto mt-4 mb-1 max-w-[240px] w-full py-2.5 text-sm font-semibold rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 transition-all"
>
{t('timestamp:convertButton')}
</button>