release: v0.3.7 — focus-visible 標準化#177
Merged
Merged
Conversation
通常 CSS のフォーカスインジケーターを `:focus { outline: none } + :focus-visible
{ outline: 2px solid var(--ring); outline-offset: 2px; }` のパターン A に統一。
色を `var(--ring)` に一本化し、`var(--primary)` は selected / pressed などの
状態色専用にする。
- CODING_RULES.md: 規約 2 行追記(focus-visible / var(--ring) の標準)
- 通常 CSS で var(--primary) を focus 色として使っていた箇所を var(--ring) に置換
- :focus + :focus-visible の冗長な併用を `outline: none` + `:focus-visible` に整理
- :focus-visible 未使用の landmarks に規約適用
- data-grid / grid / treegrid の `--focus-color, #3b82f6` を var(--ring) に統合、
dark mode の `--focus-color: #60a5fa` 定義を削除(テーマ層 --ring が吸収)
- grid 系セルは :focus 維持(キーボード/マウス両方でセルハイライトが必要なため)
- tree-view の treeitem も box-shadow を var(--ring) ベースに統一
- menubar の trigger / menuitem / submenu-trigger は :focus と :focus-visible を
分離(background は :focus、outline は :focus-visible)
- tabs.css の重複 :focus-visible (line 135 と 229) を統合
- forced-colors: active 内のセレクタは既存 :focus を維持
(マウスクリック後の現在位置表示を保つため)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Deploying apg-patterns-examples with
|
| Latest commit: |
254544d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://922a2355.apg-patterns-examples.pages.dev |
| Branch Preview URL: | https://refactor-focus-visible-stand.apg-patterns-examples.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
:focus { outline: none } + :focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }のパターン A に統一var(--primary)の focus 用途をvar(--ring)に一本化(state 色と focus 色の責務分離)var(--focus-color, #3b82f6)をvar(--ring)に統合し、.darkの--focus-color: #60a5fa定義を削除(テーマ層--ringが吸収):focus { outline: none; }の明示で対応(base のoutline-ring/50を上書き)CODING_RULES.mdに規約を追記forced-colors: active内の:focusは維持(Windows 高コントラスト利用者のマウスクリック後の現在位置表示を保つため)。shadcn/ui(src/components/ui/) は対象外。バージョン
v0.3.6→v0.3.7(patch)Test plan
npm run build通過(553 ページ)outline: none 0px(規約通り、リング出ない).focus():outline: none 0px(Chrome の:focus-visible判定でも出ない)outline: solid 2px oklch(...)で--ring由来verdict: pass)別 PR の候補
oklch(0.95 0 0)固定値、.darkで override 済み)🤖 Generated with Claude Code