Skip to content

Conversation

@schktjm
Copy link
Contributor

@schktjm schktjm commented Oct 28, 2025

関連URL

https://smarthr.atlassian.net/browse/A11Y2-68
https://smarthr.atlassian.net/browse/A11Y2-47

概要

やりたいこと

  • box-shadow ではなく outline を使用してフォーカスインジケーターを作りたい
    • box-shadow は矯正カラーモードで表示されないため
  • アウトラインが途切れる可能性がある箇所は、intent(内側) にフォーカスインジケーターを表示させたい

変更内容

  • OUTLINEの生成箇所として createOutline.ts を作成し、 createShadow.ts から削除
  • smarthr-ui-presets.tsfocus-indicator に、祖先に overflow がいる場合は内側になるように処理を追加
    • 上書きできるように :where で詳細度を 0 に
  • 内側になるもののうちおかしいものを個別に対応

変化があったもの↓

before after
image image
image image
image image

※ WarekiPicker の年を選ぶカレンダーは元のフォーカスインジケーターが hover などと違っていて違和感があったので一緒に変更を入れました

⚠️ 大きな懸念 ⚠️

inset にしている条件が、「祖先に offset-* が当たっているかどうか 」で判定しているため、ほとんどの要素が inset になる可能性があります。

また、ダイアログあり/なしで同じ要素だけどfocusの当たり方が変わるといった可能性があります。

そのため、基本insetにしつつ、insetであるとわかりにくくなる一部の要素だけouterにするという実装を考えています。

確認方法

@schktjm schktjm requested a review from a team as a code owner October 28, 2025 07:04
@schktjm schktjm requested review from moshisora and nabeliwo and removed request for a team October 28, 2025 07:04
@schktjm schktjm marked this pull request as draft October 28, 2025 07:04
@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 28, 2025

Open in StackBlitz

npm i https://pkg.pr.new/kufu/smarthr-ui@5917

commit: 9c8fe85

@schktjm schktjm force-pushed the feat-foucs-outline branch from f0f3b34 to e615dca Compare October 31, 2025 08:12
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI が落ちてる理由がわからず lint --write 系でwarningも修正したため関係ない変更が多くなってしまいました 🙇

@schktjm schktjm marked this pull request as ready for review October 31, 2025 09:04
@schktjm
Copy link
Contributor Author

schktjm commented Oct 31, 2025

通常のフォーカスインジケーターも outline を使うようになったため、強制カラーモードでもフォーカスインジケーターが表示されるようになりました 🎉

@schktjm schktjm requested review from a team, nabeliwo and s-sasaki-0529 and removed request for a team October 31, 2025 09:09
@schktjm schktjm marked this pull request as draft November 4, 2025 02:23
boxShadow: `0 0 0 2px ${theme('colors.white')}`,

/** overflow する可能性がある場合はフォーカスインジケーターを内側に設定する */
'.overflow-hidden &, .overflow-y-hidden &, .overflow-x-hidden &, .overflow-y-clip &, .overflow-x-clip &, .overflow-y-auto &, .overflow-x-auto &':
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dialog系がまずい

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants