Repository navigation
feat(extension): オプション画面のダークモード対応 - #512
Conversation
Apply the theme to the options page and add dark counterparts to its hard-coded neutral colors. The `dark:` classes are added next to the existing ones, so the light theme renders exactly as before. Monochrome icons (generic glyphs, folder SVGs) are drawn in black and vanished on dark backgrounds. In the dark theme they are now recolored like the global icon color setting does, keeping favicons, brand icons and icons excluded from recoloring as they are. This also applies to the popup menu when no popup color is customized. The resolved theme is shared through a context so that each icon does not load the settings. Refs #495 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019DvJ25jdbq4pvn4K8Wk7Mx
レビュー結果オプション画面のダークモード対応、全体として丁寧にできています。既存クラスを残して 指摘事項(軽め)
テスト
セキュリティ・性能
マージをブロックする問題はありません。上の 3 の仕様確認と 4 の型修正だけでも検討してください。 |
# Conflicts: # packages/extension/src/components/option/ShareButton.tsx
|
レビュー結果 オプション画面のダークモード対応、全体として丁寧にできています。 指摘(改善提案)
良い点
その他
🤖 Generated with Claude Code |
- Exclude recolor from OptionMenuImage props since the theme decides it - Draw StorageUsage legend swatches from BAR_COLORS to keep one source - Derive the dark popup icon color from the font color variable - Remove the theme attribute on useTheme cleanup - Note that themeContext falls back to light outside a provider - Extract usesIconColor from Popup and cover it with tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
レビューありがとうございます。855a7310 で以下を対応しました。 対応済み
仕様の確認(ダーク時に背景色だけ設定した場合のアイコン色) 今回は見送り
🤖 Generated with Claude Code |
レビュー結果オプション画面のダークモード対応、全体として丁寧にできています。 良い点
指摘・提案
セキュリティ・パフォーマンス
指摘 7 の 🤖 Generated with Claude Code |
概要
#495 のダークモード対応の第2段階です。オプション画面をダークモードに対応しました。
変更内容
useTheme(document.documentElement)を呼び、テーマを適用します。Toaster にもテーマを渡しています。dark:付きのクラスを追加しました(約130箇所)。既存のクラスは消していないので、ライト時の見た目は変わりません。gray-100→gray-800、文字gray-700→gray-300、枠線gray-200→gray-800components/uiの input、textarea、form、button も対象です。Option.module.css、Dialog.module.css、TableOfContents.module.css、HubBanner.module.cssの直書きの色に、@variant darkでダーク用の値を追加しました。Common.module.cssはcomposes経由で読み込まれ、Tailwind の処理を通りません。そのため、ここだけ:host()と属性セレクタを直接書いています。アイコンの塗り替え(ポップアップにも影響します)
黒一色のアイコン(汎用アイコンやフォルダの SVG)は、暗い背景では見えなくなります。そこでダーク時は、既存の「グローバルアイコン色」と同じ判定でアイコンを明るい色に塗り替えます。favicon、ブランドアイコン、「グローバルアイコン色から除外」を設定したアイコンは元の色のままです。
OptionMenuImageを使って塗り替えます。themeContextで配っています。確認
tsc -b、yarn lint(エラー0件)、vitest(全件成功)、yarn buildMenuImageのrecolorprop、OptionMenuImage対象外(後続PRで対応)
Refs #495
🤖 Generated with Claude Code
https://claude.ai/code/session_019DvJ25jdbq4pvn4K8Wk7Mx