atom / one-light-ui

Atom One light UI theme
MIT License
73 stars 62 forks source link

Stronger focus style for buttons #93

Closed simurai closed 7 years ago

simurai commented 7 years ago

Prerequisites

Description

The styling when something is focused is pretty strong for inputs, it adds a blue border around an input. But for buttons it's pretty weak and hard to see.

focus

Steps to Reproduce

  1. Open Settings > Install
  2. Press cmd to move the focus to "Packages" and "Themes"

Expected behavior:

Buttons should be easy to see when they get focused with the keyboard

Actual behavior:

Buttons are hard to see when they get focused with the keyboard

Reproduces how often:

100%

Versions

You can get this information from copy and pasting the output of atom --version and apm --version from the command line. Also, please include the OS and what version of the OS you're running.

Atom    : 1.16.0-dev-6f9a536
Electron: 1.3.13
Chrome  : 52.0.2743.82
Node    : 6.5.0

Additional Information

The reason for the weak style is that in Chromium, if you click a button with your mouse, it adds the :focus style to that button until you click somewhere else. See this Accessible Styles post for more details.

There is proposal to add a :focusring selector that would allow to have a different style only when focused with the keyboard. But that might still take a while till it's implemented. Other options:

  1. Use JS to add some sort of "focused with the keyboard/mouse" class and then style that differently.
  2. Make the :focus style stronger, even if it looks too obtrusive.

Let's try option 2 first since that seems simpler. Also, because Atom is an application where the keyboard is used a lot we shouldn't compromise usability for it.