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

Ternary button for theme/color mode is an anti-pattern #1941

Open
gabalafou opened this issue Jul 25, 2024 · 1 comment
Open

Ternary button for theme/color mode is an anti-pattern #1941

gabalafou opened this issue Jul 25, 2024 · 1 comment
Labels
tag: component Issues or improvements associated with a given component in the theme

Comments

@gabalafou
Copy link
Collaborator

gabalafou commented Jul 25, 2024

There was a discussion about the light/dark/auto button, and there was general support to make it more like the one in the MDN docs.

@gabalafou gabalafou changed the title Make theme switcher more like MDN Tri-state theme switcher button is an anti-pattern Jul 25, 2024
@gabalafou gabalafou changed the title Tri-state theme switcher button is an anti-pattern Ternary button for theme/color mode is an anti-pattern Jul 25, 2024
@trallard trallard added the tag: component Issues or improvements associated with a given component in the theme label Sep 3, 2024
@smeragoel
Copy link
Contributor

I feel that there are two slightly separate discussions here, this is how I interpreted it:

  • The original issue was that the Auto option in the theme switcher is not necessary because of a bug that set auto==light theme for the user all the time, so they wanted to remove the auto option.
  • Your suggestion to switch from a ternary button to a dropdown - it'll still have the auto option, but just might make it easier for folks to customise what themes they want.

I think switching to a dropdown is an excellent idea. I don't pay much attention to the icons, and just click the button rapidly until I get the desired theme, often cycling multiple times so I'd personally also prefer the dropdown.

From a UX perspective, a dropdown will:

  • Give better control over switching the themes
  • Allow us to explicitly write the theme names so that we don't have to rely on icons (which are not universal)
  • Allowing people to add more themes!

I did a quick mockup of this on Figma, however, this is not a new design and is reusing the dropdown component we already use in the theme, along with options that have icons next to them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tag: component Issues or improvements associated with a given component in the theme
Projects
None yet
Development

No branches or pull requests

3 participants