Open LukasHirt opened 5 years ago
It is hard to differentiate the normal state from the focus state. The color contrasts of the border colors of the normal and focus-state don't differ enough.
* By WCAG Success Criteria 1.4.11 (here's the official explainer document)
Like with most color related issues this isn't a development/code issue alone, it has to be coordinated with a visual design department possibly (and also theming must be taken into consideration). Nevertheless my suggestion for a focus style adhering to the points above would be (simplified code):
.oc-button:focus {
border-color: #002966;
box-shadow: inset 0px 0px 0px 1px #002966;
}
@PVince81 @LukasHirt
As agreed upon at the sprint planning meeting last monday, here's my take/proposal on much more prominent focus styles, and then show it to @wuenschedesign and the team to gather feedback. I tried to stay inside the established color palette, while still sticking to the contrast ratios quoted above.
Take note:
See below several demo images and a short video of how I would subtly animate the focus.
The following drafts show the normal, hover, active, focus and disabled state of input fields and buttons.
Normal Vision | Color Blindness | Low Vision |
---|---|---|
Normal Vision | Color Blindness | Low Vision |
---|---|---|
List View with marked Focus States of various elements in the UI:
@PVince81 @DeepDiver1975 @LukasHirt : I need some feedback, how a focus state must be implemented, e. g. does an additional border change the dimension of an element/button and thus makes a UI „jump“?
@wuenschedesign In my "prototyping" for the screenshots above I used CSS properties outline
and box-shadow
to prevent jumping. There is no hard rule how these styles must be implemented (only regarding visual styling). I prototyped not all possible interactive elements for the demo, only the ones pictured above. But I reckon jumping can be prevented with these measures in general.
How does a box shadow work with icons (free form as an outline)? Is the shadow applied to the trimbox of the icon or the free form? Is this trimbox always equal to the touch target of an UI item?
@wuenschedesign I'm not familiar with the term trimbox, but I guess that is the answer. Like in my demos above, I used box-shadow not for a realistic drop shadow but for a rectangular border that is not part of the CSS box model, therefore preventing a jump (these jumps are at the amount of the "width" of the border, but even noticable when its 1px. Thus: "outline" with box shadow, or where possible, with CSS's outline
)
A preliminary draft to show the status of controls, checkboxes, toggleswitches. Probably there’s no need for a hover or disabled state In certain cases (Making an option invisible instead of turning it to disabled status).
@wuenschedesign In my opinion on some items like the favorite star the visual difference between normal and focussed is way too subtle. In some regards it is as un-prominent as the current state in Phoenix.
One info: It is technically possible to restrict the focus styles to keyboard/non-pointer usage alone (:focus-visible
in CSS), therefore a user with a pointing device (touch, mouse) won't ever get a focus style, even when they set the control focussed after click (that unwanted effect is the main reason that focus styles get removed in the first place).
So my recommendation is: You can/should be way more bold and obvious with the focus styles (see my demos).
Description
Focus styles of all buttons, checkboxes, links does only slightly differ from the normal state - often times it is not obvious which piece of interface has focus