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

font switcher #604

Merged
merged 12 commits into from
Oct 25, 2024
Merged

font switcher #604

merged 12 commits into from
Oct 25, 2024

Conversation

Rich-Harris
Copy link
Member

WIP. Need a better icon, and some of the variables could probably use more tweaking

Copy link

vercel bot commented Oct 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
kit-svelte-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 25, 2024 6:54pm
learn-svelte-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 25, 2024 6:54pm
omnisite ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 25, 2024 6:54pm
svelte-5-preview 🔄 Building (Inspect) Visit Preview 💬 Add feedback Oct 25, 2024 6:54pm
svelte-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 25, 2024 6:54pm

@Rich-Harris
Copy link
Member Author

(also system-ui probably isn't the best sans option)

@kvetoslavnovak
Copy link

kvetoslavnovak commented Oct 30, 2024

Shouldn't the toggle icon be reversed? When we're on the serif font page, the switcher should display the sans-serif icon, and when we're on the sans-serif page, it should show the serif icon. But I see the same 'reverse psychology' is used for the dark/light theme button as well! :-)

EDIT:
I did some researche:
The toggle button generally works best when it displays the option it will change to, not the current setting. This approach aligns with most user interface conventions and helps users anticipate the action. For instance, if you're in light mode, the button would show a moon icon (dark mode), indicating that pressing it will switch to dark mode. This “show the next option” style can feel intuitive because it’s a clear cue about what will happen next.

The reverse—showing the current setting—can sometimes feel confusing because users might assume that’s the state they’re switching to, not the one they’re already in. That said, there are successful apps using both approaches, especially when aiming for a “live preview” feel (e.g., showing the current style applied to the icon itself).

In short, showing the next option tends to be more widely understood, though some user preferences and app styles may favor the current-state display.

It really is like the old analog console or wall toggle buttons, you press the option that you want to happen.

@Rich-Harris Rich-Harris mentioned this pull request Oct 30, 2024
@Rich-Harris
Copy link
Member Author

good point! #718

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 this pull request may close these issues.

3 participants