Problem/Motivation

We implemented checkbox and radio styling before the introduction of the green focus ring so it has its own custom focus effect which is much less visible than the green focus ring.
This has already been adjusted in the style guide but has yet to be implemented in Claro.

Proposed resolution

Implement the green focus ring to checkboxes and radioss in Claro.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

AntoineH created an issue. See original summary.

ant1’s picture

Assigned: Unassigned » ant1
ant1’s picture

Assigned: ant1 » Unassigned
Status: Active » Needs review
StatusFileSize
new12.81 KB
ckrina’s picture

Thanks for working on this @AntoineH! I've checked the design implementation and looks good. I'll leave the code review to @lauriii. :)

anevins’s picture

Wow that looks very cool! Should we darken the green so that it has better contrast? The current green (I think) is #28aC67, which falls slightly short of a 3:1 contrast ratio between the green and the background white: https://webaim.org/resources/contrastchecker/

lauriii’s picture

@anevins could you open separate issue to discuss the contrast ration of the focus ring? This color is used in various different places and it would be great to fix them all at once.

ckrina’s picture

FYI per the designs the green should be #26A769, with a 3.08:1 contrast that afaik should be enough for graphic elements. But it makes sense to address it in another issue together with other components.

lauriii’s picture

Status: Needs review » Needs work

This looks great!

I found a pre-existing issue that becomes worse. According to the design system, there should be 8px between the form element and the label. However, our current implementation only has 6px, and when we add the focus effect, it renders very close to the label as a result. We should probably fix that as part of this issue.

fhaeberle’s picture

Status: Needs work » Needs review
StatusFileSize
new13.93 KB
new1.51 KB

I updated the form elements (checkbox&radio) with the new spacing. Please review! :)

fhaeberle’s picture

Fixing whitespace lint error.

quiron’s picture

Just my 2 cents, isn't outline (https://www.w3.org/TR/css-ui-4/#outline-props) the right CSS property to managing this kind of status highlighting?

lauriii’s picture

StatusFileSize
new60.4 KB

@quiron outline supports only some very basic use cases. Our design has multiple outlines (2px white, 3px green) which isn't supported by outline. Because of Windows high contrast doesn't render box-shadow, we define a transparent outline that will be visible there.

It seems like the latest patch doesn't work as expected. With the latest patch there's no spacing between the input and the label at all.

fhaeberle’s picture

Sorry, changed the variable name but forgot to update!
This patch should be working.

  • lauriii committed 90341fc on 8.x-1.x
    Issue #3076528 by fhaeberle, AntoineH, ckrina, lauriii, anevins:...
lauriii’s picture

Status: Needs review » Fixed

Thank you! Looks great! Committed and pushed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.