Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2021/10/05] Frontend Night #167

Closed
jjenko opened this issue Sep 28, 2021 · 1 comment
Closed

[2021/10/05] Frontend Night #167

jjenko opened this issue Sep 28, 2021 · 1 comment

Comments

@jjenko
Copy link

jjenko commented Sep 28, 2021

Policy

  • 資料の準備をがんばらない
  • 参加・途中退席は自由
  • スキップしない

話したい・聞きたいネタを書いてく ✏️

ハッシュタグ #frontend_night

Prev: #165

Created from #65 by issue-creator

@kobayang
Copy link

kobayang commented Oct 1, 2021

Accessible Icon Buttons

Icon ボタンのアクセシビリティを高めるための話。

  • Chrome Devtools で a11y を確認する方法について
  • button または role="button" を追加する
  • Icon の隣に Text を表示する

また、Text がない Icon についての Accessible な実装について3つ紹介している

    1. width 1px で hidden な Text を差し込む
    1. 完全に hidden(display: none) な Text と aria-labelledBy を組み合わせる
    1. aria-label を設定する
    • aria-label は、a11y の contents を上書きしてしまうことに注意しなければならない

感想として、Text がない Icon ボタンの場合は aria-label をつける 3のパターン、そうでない場合は aria-labelledBy と hidden Text を組み合わせる 2のパターンが実装方針として良いのではないかと思った。

上記の実装が実現できていると、 https://testing-library.com/docs/queries/byrole/getByRole("button", { name: "label" } で DOM が指定できるようになるので、ボタンを実装する際には心がけたい。

@wantedly wantedly locked and limited conversation to collaborators Oct 5, 2021
@chloe463 chloe463 closed this as completed Oct 5, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants