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

fix: improve default font family #2314

Merged
merged 1 commit into from Aug 9, 2023
Merged

Conversation

liberaldev
Copy link
Contributor

@liberaldev liberaldev commented Aug 8, 2023

Currently, elk's font-family is based on the @unocss/reset/tailwind.css file. The font-family in tailwind css is Mac-centric and does not take into account the Windows environment (specifically the CJK Windows environment).

The biggest problem with the font-family in tailwind css is the presence of system-ui, which breaks readability in the CJK windowing environment. In addition to breaking readability on Windows(https://infinnie.github.io/blog/2017/systemui.html), system-ui does not take advantage of the ability to change fonts based on lang attributes.

스크린샷 2023-08-08 211437
Current ELK client. Because of system-ui, it renders Malgun Gothic(This is Korean font. This is not japanese font) instead of Japanese fonts, and the Japanese readability of Malgun Gothicc is horrible.

스크린샷 2023-08-08 211550
After removing system-ui, the correct Japanese font is loaded.

This PR fixes this issue.

@stackblitz
Copy link

stackblitz bot commented Aug 8, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@netlify
Copy link

netlify bot commented Aug 8, 2023

Deploy Preview for elk-zone ready!

Name Link
🔨 Latest commit 9f38a7d
🔍 Latest deploy log https://app.netlify.com/sites/elk-zone/deploys/64d2365dd81e760008fab360
😎 Deploy Preview https://deploy-preview-2314--elk-zone.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@netlify
Copy link

netlify bot commented Aug 8, 2023

Deploy Preview for elk-docs canceled.

Name Link
🔨 Latest commit 9f38a7d
🔍 Latest deploy log https://app.netlify.com/sites/elk-docs/deploys/64d2365d9ecc890008085ea8

@liberaldev liberaldev changed the title Font family fix fix: Font family fix Aug 8, 2023
@liberaldev liberaldev changed the title fix: Font family fix feat: Font family fix Aug 8, 2023
@antfu antfu changed the title feat: Font family fix fix: improve default font family Aug 8, 2023
@antfu antfu added this pull request to the merge queue Aug 9, 2023
Merged via the queue into elk-zone:main with commit f3d17d3 Aug 9, 2023
20 of 21 checks passed
@liberaldev liberaldev deleted the font-family-fix branch August 9, 2023 11:50
@last-partizan
Copy link

Oh, that's unfortunate change.

I noticed that elk font changed from my standard system font to something different, and traced the change to this PR.

If the change targeted only at windows, maybe there is a way to apply it only to windows?

I can make a PR using following approach: https://stackoverflow.com/questions/27704917/apply-css-only-for-linux-chrome-but-not-for-windows-chrome if that's considered a good idea.

@liberaldev
Copy link
Contributor Author

Oh, that's unfortunate change.

I noticed that elk font changed from my standard system font to something different, and traced the change to this PR.

If the change targeted only at windows, maybe there is a way to apply it only to windows?

I can make a PR using following approach: https://stackoverflow.com/questions/27704917/apply-css-only-for-linux-chrome-but-not-for-windows-chrome if that's considered a good idea.

The current font family is also the system font. However, if you have any of Segoe UI, Roboto, Helvetica Neue, Arial, or Noto Sans installed on your system, the fonts will be rendered in the aforementioned order. Which OS do you use?

@last-partizan
Copy link

I'm using Linux, with Gnome and my system font is not standard one, but custom one "Nokia Sans S60". So it works only when using generic family like system-ui or ui-sans-serif.

@liberaldev
Copy link
Contributor Author

liberaldev commented Aug 28, 2023

I'm using Linux, with Gnome and my system font is not standard one, but custom one "Nokia Sans S60". So it works only when using generic family like system-ui or ui-sans-serif.

If you want to use the Nokia Sans S60 font, install the stylus extension (Firefox: https://addons.mozilla.org/ko/firefox/addon/styl-us/, Chrome: https://chrome.google.com/webstore/detail/stylus/clngdbkpkpeebahjckkjfobafhncgmne) and apply the following CSS. It's open source, so there are no privacy concerns.(https://github.com/openstyles/stylus)

html { font-family: "Nokia Sans S60", system-ui, sans-serif; }

If you're not font specific and want to use the system-ui font, use the code below.

html { font-family: system-ui, sans-serif; }

@last-partizan
Copy link

Yeah, that works.

Thank you.

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.

None yet

4 participants