-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: Focus rings #1633
Feat: Focus rings #1633
Conversation
@srhhnry Once this PR is reviewed, approved and merged, you'll be able to test the focus rings on dev-benefits.calitp.org/ |
Sounds great! I was having trouble with codepen (couldn't keep the focus state sustained, as I think it was a click action, so plugins were having a hard time). But all these screenshots look good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really good @machikoyasuda! I have one question about the radio input focus ring and noticed a bug that we could fix as a part of this PR.
@@ -580,6 +608,12 @@ footer .footer-links li a:visited { | |||
box-shadow: inset 0 0 0 var(--border-width) var(--bs-white); | |||
} | |||
|
|||
.radio-input:focus, | |||
.radio-input:focus-visible { | |||
outline: 2px solid var(--focus-color) !important; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's hard to figure out the width of the yellow circle's stroke. But I got the 2px from this:
<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="15" cy="15" r="8" fill="#323A45"/>
<circle cx="15" cy="15" r="11" stroke="#323A45" stroke-width="2"/>
<circle cx="15" cy="15" r="14" stroke="#FDB714" stroke-width="2"/>
</svg>
This line specifically:
<circle cx="15" cy="15" r="14" stroke="#FDB714" stroke-width="2"/>
The yellow circle has a stroke-width of 2px, so that's why I set the radio button focus ring to 2px.
@srhhnry Should the focus ring for radio input be 2px (matches Figma) or 3px (matches all the other rings)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@machikoyasuda Hmm, yeah I see how the Figma says the radio input border should be 2px and all the others are 3px. I wonder why 2px is causing it to look so narrow on the radio input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the focus ring for radio input be 2px (matches Figma) or 3px (matches all the other rings)?
@srhhnry Just to clarify this question, I don't think we're questioning the use of 2px in Figma for the radio input, but rather it seems like for some reason Figma and the browser are not showing 2px the same way. So I think what we're trying to decide is if we should just use 2px even though it doesn't look quite like Figma or use 3px even though that's not what Figma says.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@machikoyasuda Maybe we just merge this in with 2px so Sarah (or whoever on the design team 😄) can take a look at it on the dev site and decide if it looks too narrow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea - I'd also bet if we put our Mac vs Windows machines side by side, it might look a lil different between our machines. The input is gonna look different from Figma cos the Figma input was created from scratch. And your screenshots look a lil different from my Mac/Firefox rendering too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Ok, I feel good about leaving this as 2px and having design look at it later, either as a part of a design QA or whenever design has time.
Co-authored-by: Angela Tran <[email protected]>
Co-authored-by: Angela Tran <[email protected]>
closes #1387
What this PR does
Specs
#fdb714
or#fafafa
card
, there is an extra box-shadow.What it looks like
Focus rings are activated by the keyboard tab, so they're usually seen on Desktop mode.