techno-tim / littlelink-server

A lightweight, open source, stateless, and self-hosted alternative to linktree in a Docker container!
https://links.technotim.live
MIT License
921 stars 162 forks source link

CSS :focus, do we really need it ? #29

Closed Choubakawa closed 2 years ago

Choubakawa commented 3 years ago

I may be missing the point of :focus (accessibility ?) but I think using this attribute is not needed in this project.

I take the button list like a menu, if I click on it I leave the page and if I return on my littlelink page the button is focused, I would expect the button come back to its initial state.

palepinkdot commented 3 years ago

It does remove redundant functionality. the :focus and :hover pseudo-classes perform duplicate functions. Hovering over an icon darkens the background colors and clicking it, using the :focus class forces the button to stay darkened.

The :focus class also introduces some unintended functionality on mobile as well. If you tap and slide your finger off the button it remains darkened. I don't think this is intended.

I think for the normal use case for this app, it doesn't really matter (Open page in embedded mobile browser > Click link > Close embedded browser), but it does make things a bit messy with caching the focused result upon returning to the page. Definitely nitpicking with this issue but it seems like it could improve the UX of at least one user, IMO it's worth the change.