Don't show focus outline on buttons for mouse users

Update: keeping it - gitlab-org/gitlab-services/design.gitlab.com!3753 (merged)

We currently show the focus outline for all input types, but it is not useful for all users. For mouse or touchscreen -heavy users, the focused element is important when inputting text. On phones it shows why the keyboard is visible.

Reasons to remove it

  • looks a bit out of place for people who don't need it
  • browser's focus-visible interpretation similar to user-agent preferences (maybe?)

Reasons to keep it

  • more people seeing focus rings means less chance of accidentally introducing focus-ring bugs (like overflow: hidden cutting off the outline)
  • focus-within can be too naive. We can’t assume only keyboard users benefit from visible focus"
  • Gives all inputs consistent outlines. Most recently unified in !2687 (merged)
  • relevant discussion, #1219 (closed) and is also relevant.
  • For loading async content (or switching away from/back to page) you can forget your place. Focus can serve similar role to highlighting current section
  • The focus outline confirms the button someone pressed. Helpful for users with tremors, or any time someone's finger covers a control

Links

https://craftcms.com/blog/understanding-visible-focus-indicators

Edited by Simon Knox