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

Redesign radio to match with checkbox #2111

Closed
1 task
Tracked by #2086
Febakke opened this issue Jun 7, 2024 · 4 comments
Closed
1 task
Tracked by #2086

Redesign radio to match with checkbox #2111

Febakke opened this issue Jun 7, 2024 · 4 comments
Assignees

Comments

@Febakke
Copy link
Member

Febakke commented Jun 7, 2024

When we implemented radio and checkbox with darkmode. We noticed that they dont match very well. We should try to alter the design of the radio button to handle darkmode better.

Elements we want

  • checked components are filled
  • Contrast color

Image

Image

Tasks

Preview Give feedback
@Febakke Febakke converted this from a draft issue Jun 7, 2024
@Febakke Febakke moved this from ☂ Epics to 🏗 In progress in Team Design System Jun 11, 2024
@Febakke
Copy link
Member Author

Febakke commented Jun 11, 2024

My first instinct is to add white to the "gap" inside the radiobutton. Hoping this would make the radio more visible and match with our checkbox. But this did not pan out. We have experience from working on focus indicators that radios get weird looking when you ad more circles.

Image

Next was to draw inspiration from other designsystems that support darkmode. And there are many ways that this can be handled. One is let the check and "gap" have the background color. As shown in the screenshot 👇
Image

They look better as a pair of components, but they are very subdued. I wish the selected inputs would be more visible.

We also looked into a outline versjon. But when you remove fill, they also get less visible and harder to read.
Image

The version we have most hope for is the one inspired by Mantine. This will give us fill and a white indicator.

Image

Cons:

  • We need to use the contrast-default as color for the check/circle. If the base color is to light this color will be black instead of white. And be less visible in darkmode. And look weird in lightmode.
  • It might be nitpicking, but I feel like it looks less "filled" than our current version. This is most apparent in the light version. Will this be a problem? There might be a reason why so many has implemented radio the way we have today.

Example in light mode
Image

@Febakke Febakke self-assigned this Jun 11, 2024
@Thunear
Copy link
Collaborator

Thunear commented Jun 11, 2024

I think we need to use the contrast color inside the radio button and the checkbox to make sure the contrast is sufficient in both light- and dark mode. Using just the background, as in the second example, is very problematic because a color cannot contrast properly against both dark and light colors at the same time. I like the Mantine example the most. Makes the checkbox and radio buttons fit together very nicely, and also makes sure contrasts work.

@mrosvik
Copy link
Member

mrosvik commented Jun 28, 2024

Should use token accent-contrast-1 to make sure it gets enough contrast. @Febakke

@Barsnes
Copy link
Member

Barsnes commented Jul 2, 2024

This has been done in Figma, and in React #2130

@Barsnes Barsnes closed this as completed Jul 2, 2024
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Team Design System Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

4 participants