Created
January 8, 2025 17:29
-
-
Save diaowinner/74fea98031cb260499d3c8899a9e06cb to your computer and use it in GitHub Desktop.
HarmonyOS Sans for Mastodon!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* ==UserStyle== | |
| @name Mastodon HarmonyOS Sans Theme | |
| @namespace cc.dwnfonts.hmosmstdn | |
| @version 0.1 | |
| @description Use HarmonyOS Sans VF in Mastodon! | |
| @author diaowinner | |
| @preprocessor stylus | |
| @var checkbox tcflavor "Traditional Chinese" 0 | |
| ==/UserStyle== */ | |
| @-moz-document domain("mas.to"), domain("typo.social") | |
| // add ur instance here 👆 | |
| // path to the HarmonyOS Sans' folder | |
| path-to-folder = "https://dwn.dwnfonts.cc/assets/hm/" | |
| //import font | |
| @font-face | |
| font-family: HM Symbol | |
| src: url(join('',path-to-folder, "HMSymbolVF.woff2")) format(woff2) | |
| @font-face | |
| font-family: HarmonyOS Sans | |
| font-style: normal | |
| src: url(join('',path-to-folder, "HarmonyOS_Sans.woff2")) format(woff2) | |
| @font-face | |
| font-family: HarmonyOS Sans | |
| font-style: italic | |
| src: url(join('',path-to-folder, "HarmonyOS_Sans_Italic.woff2")) format(woff2) | |
| @font-face | |
| font-family: HarmonyOS Sans | |
| font-stretch: condensed | |
| font-style: normal | |
| src: url(join('',path-to-folder, "HarmonyOS_Sans_Condensed.woff2")) | |
| @font-face | |
| font-family: HarmonyOS Sans | |
| font-stretch: condensed | |
| font-style: italic | |
| src: url(join('',path-to-folder, "HarmonyOS_Sans_Condensed_Italic.woff2")) | |
| @font-face | |
| font-family: HarmonyOS Sans Digit | |
| font-weight: 400 | |
| src: url(join('',path-to-folder, "HarmonyOS_Sans_Digit.woff2")) format(woff2) | |
| @font-face | |
| font-family: HarmonyOS Sans Digit | |
| font-weight: 500 | |
| src: url(join('',path-to-folder, "HarmonyOS_Sans_Digit_Medium.woff2")) format(woff2) | |
| @font-face | |
| font-family: HarmonyOS Sans Naskh Arabic | |
| src: url(join('',path-to-folder, "HarmonyOS_Sans_Naskh_Arabic.woff2")) format(woff2) | |
| @font-face | |
| font-family: HarmonyOS Sans Naskh Arabic UI | |
| src: url(join('',path-to-folder, "HarmonyOS_Sans_Naskh_Arabic_UI.woff2")) format(woff2) | |
| @font-face | |
| font-family: HarmonyOS Sans SC | |
| src: url(join('',path-to-folder, "HarmonyOS_Sans_SC.woff2")) format(woff2) | |
| @font-face | |
| font-family: HarmonyOS Sans TC | |
| src: url(join('',path-to-folder, "HarmonyOS_Sans_TC.woff2")) format(woff2) | |
| // default from mastodon | |
| mastodefault = system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif, BlinkMacSystemFont, Oxygen, Fira Sans, Droid Sans, Helvetica Neue, "mastodon-font-sans-serif" | |
| // check if it's TC flavor | |
| primarychnfnt = tcflavor == 1 ? HarmonyOS Sans TC : HarmonyOS Sans SC | |
| secondarychnfnt = tcflavor == 1 ? HarmonyOS Sans SC : HarmonyOS Sans TC | |
| // other language | |
| body.system-font | |
| font-family: HarmonyOS Sans, primarychnfnt, secondarychnfnt, HarmonyOS Sans Naskh Arabic UI, mastodefault | |
| // Chinese | |
| body.system-font *:lang(zh) | |
| font-family: primarychnfnt, secondarychnfnt, HarmonyOS Sans, HarmonyOS Sans Naskh Arabic UI, mastodefault | |
| // simplified | |
| body.system-font *:lang(zh-Hans, zh-CN, zh-SG) | |
| font-family: HarmonyOS Sans SC, HarmonyOS Sans TC, HarmonyOS Sans, HarmonyOS Sans Naskh Arabic UI, mastodefault | |
| // traditional | |
| body.system-font *:lang(zh-Hant, zh-TW, zh-HK, zh-MO) | |
| font-family: HarmonyOS Sans TC, HarmonyOS Sans SC, HarmonyOS Sans, HarmonyOS Sans Naskh Arabic UI, mastodefault | |
| // arabic | |
| body.system-font *:lang(ar) | |
| font-family: HarmonyOS Sans Naskh Arabic UI, HarmonyOS Sans SC, HarmonyOS Sans TC, HarmonyOS Sans, mastodefault |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment