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

Inconsistent display of the theme switcher icon #144

Closed
palant opened this issue May 15, 2020 · 8 comments · Fixed by #155
Closed

Inconsistent display of the theme switcher icon #144

palant opened this issue May 15, 2020 · 8 comments · Fixed by #155
Labels
enhancement New feature or request
Milestone

Comments

@palant
Copy link
Collaborator

palant commented May 15, 2020

The theme switcher icon relies on the system font which can vary a lot. I set font-size: 140% for mine (it was barely visible in Chrome on Linux) and here is what I got:

WindowsLinux FirefoxLinux Chrome
WindowsLinux FirefoxLinux Chrome

From left to right: Windows (both Firefox and Chrome), Linux (Firefox), Linux (Chrome). Not only does the color vary, the size isn't consistent either. So I now have it overly large on Windows, but at least it should be visible in any browser.

Maybe it's a good idea to use an SVG icon for this, at least optionally?

@dawnow
Copy link

dawnow commented May 15, 2020

@palant I have the same needs, and I discovered the country flag that language switcher icon only show two characters on my Windows device. But it's normal on my Android phone.

@reuixiy
Copy link
Owner

reuixiy commented May 15, 2020

Okay, let's do this. Meanwhile, improve the accessibility(#111) of them also.

@reuixiy reuixiy added the enhancement New feature or request label May 15, 2020
@reuixiy reuixiy added this to the v4.4.0 milestone May 15, 2020
@reuixiy
Copy link
Owner

reuixiy commented May 16, 2020

What do you think of this toggle? https://codepen.io/bnthor/pen/WQBNxO

@palant
Copy link
Collaborator Author

palant commented May 16, 2020

Looks nice but takes up too much space. And isn't as nice any more when scaled down. Fewer visual elements is actually better here.

@reuixiy
Copy link
Owner

reuixiy commented May 16, 2020

Agreed.

@reuixiy
Copy link
Owner

reuixiy commented May 16, 2020

I'm working on it now. You can test it in branch theme-switcher.

@reuixiy
Copy link
Owner

reuixiy commented May 16, 2020

I discovered the country flag that language switcher icon

@dawnow The multilingual switcher, however, its content comes directly from the languageName param currently, so it‘s a bit more complicated to handle. I need more time to think about it, maybe I will solve this while dealing with #111.

@palant
Copy link
Collaborator Author

palant commented May 17, 2020

The code on the branch looks good to me now. I didn't see it in action however.

reuixiy added a commit that referenced this issue May 17, 2020
Fixes #144

* Use SVG icon for theme switcher

* Replace innerHTML with CSS selectors

* Add some magic to moon icon

* Update sun icon

* Simplify

* Do not add icons if theme switcher is hidden

* Fix a careless bug
ulmefors pushed a commit to ulmefors/hugo-theme-meme that referenced this issue Nov 22, 2020
Fixes reuixiy#144

* Use SVG icon for theme switcher

* Replace innerHTML with CSS selectors

* Add some magic to moon icon

* Update sun icon

* Simplify

* Do not add icons if theme switcher is hidden

* Fix a careless bug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants