Skip to content
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

Make focus-indicators more uniform across components #1733

Closed
vnys opened this issue Nov 29, 2021 · 6 comments · Fixed by #2016
Closed

Make focus-indicators more uniform across components #1733

vnys opened this issue Nov 29, 2021 · 6 comments · Fixed by #2016
Assignees

Comments

@vnys
Copy link
Member

vnys commented Nov 29, 2021

Both clickbounds and focus-indicators vary greatly across components, as can be seen in the screenshot. Most components have dotted outlines, but not all – and the spacing between the components and the focus-indicators are inconsistent.

image

@vnys
Copy link
Member Author

vnys commented Nov 29, 2021

@mimarz
Copy link
Contributor

mimarz commented Nov 29, 2021

We've had long discussions about this all year, in short we've landed on these approaches so far

  • Input having a solid line is intended
  • "Ghost" components should have a focus which matches the hover/clickbound box
  • "Contained/filled" have the focus frame with a offset

Focus frame being a dotted line, with 2px width.

With the changes to rendering focus, we've noticed that the outline offset became to small & outline line to thin.

@oddvernes
Copy link
Collaborator

the focus frame currently is 1px dashed. Just changing it to 2px makes a big difference, and then maybe increase the offset from 2px to 3px

@vnys
Copy link
Member Author

vnys commented Nov 29, 2021

Let’s discuss this issue in the backlog meeting on Wednesday

@oddvernes
Copy link
Collaborator

After discussion with @lucasveil and @mimarz we have decided to decouple the focus-width from figma and instead hard code it in the figma broker to 2px. I will go over each component with focus-visible and test plus adjust offset where needed so we get a consistently visible focus ring

@oddvernes
Copy link
Collaborator

oddvernes commented Feb 23, 2022

Components with focus-visible (that uses dashed outline) have been updated to fetch outline-width from token, and token have been updated to 2px, but for now this is hardcoded in figma-broker.
In the future we may have a 'second-source-of-truth' config for styles figma does not support or otherwise cannot be fetched from figma (#1388 ).

Radio/Checkbox: offset reduced by 1px so focus-ring doesn't touch label, table borders:
bilde
bilde

Button/Chip/Slider: increase offset by 1px to make where focus is it easier to spot when scanning:
bilde
bilde
bilde

Ghost_icon button: offset -2px so it is inset to clickbounds and fit inside table
bilde

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants