-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add tooltip to progress meters #47
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay reviewing this @at-the-vr! Thank you for tackling it 💜
Left one note about the DOM structure. Here are a couple of other considerations:
-
Currently the tooltip reveals on hover, but it would be good to also make it appear when the link is focused if possible. That way the tooltip would be more accessible to keyboard users.
-
Small nit, but it should be possible to position the tooltip centrally relative to the bar. Currently it aligns the left edge to the center:
Using a-translate-x-1/2
class should do that I think.
<span class="sr-only">{repoCount} {type}</span> | ||
<span | ||
aria-hidden="true" | ||
class="invisible absolute z-50 -mt-8 rounded bg-gray-100 p-1 text-neutral-700 opacity-0 transition-opacity duration-300 ease-in-out group-hover:visible group-hover:opacity-100" | ||
> | ||
{repoCount.toString()} | ||
</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be good to use the existing sr-only
element here instead of adding an extra one as the current approach impacts accessibility: a screenreader would read for example something like “starlight 22 reviews 22” instead of the current “starlight 22 reviews”.
Tailwind has a not-sr-only
class for undoing sr-only
styles, so you could probably use a similar approach to what you have now, but applying that class when the hover kicks in.
Hey Chris, the logic behind making the tooltip appear with link on focus is something I am unable to achieve. Every other suggestion was tried locally and it works but without the focus feature its just getting blocked. I will close the PR on that note |
No problem @at-the-vr! Also, don’t hesitate to mention when you get stuck on something — maybe someone else can help out. To give you a hint: I probably would have tried moving the But no pressure to spend time on this if you already feel like you invested enough energy — we only have so much time 💜 |
commit/PR itself are done via Gitpod in the meantime🙏