Last active
January 9, 2023 04:43
-
-
Save luoling8192/f8c9c511c7da7b99efd58766500ff084 to your computer and use it in GitHub Desktop.
Stylus - 全局字体美化
This file contains 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
/* 全局字体美化 | |
* 作者:RainbowBird | |
* https://gist.github.com/rain15z3/f8c9c511c7da7b99efd58766500ff084 | |
*/ | |
@font-face { | |
font-family: monospace; | |
src: local("JetBrains Mono"), local("PingFang SC"); | |
} | |
@font-face { | |
font-family: serif; | |
src: local("Segoe UI"), local("PingFang SC"); | |
} | |
@font-face { | |
font-family: sans-serif; | |
src: local("Segoe UI"), local("PingFang SC"); | |
} | |
/* 替换字体时排除图标 */ | |
*:not([class*="ico"]):not(svg):not(path) { | |
font-family: sans-serif; | |
font-weight: 500 !important; | |
} | |
/* 字体阴影 */ | |
*:not([class*="danma"]):not([class*="danmu"]) { | |
text-shadow: rgba(0, 0, 0, .8) 0px 0px 0px; | |
} | |
/* 黑体文字 */ | |
b, strong { | |
font-weight: 900 !important; | |
/*background: rgba(128, 128, 128, .35);*/ | |
background: rgba(255, 255, 0, .35); | |
} | |
h1 > b, h1 > strong, | |
h2 > b, h2 > strong, | |
h3 > b, h3 > strong { | |
background: none; | |
} | |
/* 代码使用等宽字体 */ | |
code, code > *, code > * > *, | |
pre, pre > *, pre > * > *, | |
var, var > *, var > * > * { | |
font-family: monospace !important; | |
} | |
/* 脚本适配 Ace.js */ | |
[class*="ace"] { | |
font-family: monospace !important; | |
} | |
@-moz-document domain("github.com") { | |
/* Github */ | |
[class*="blob-code"], | |
[class*="blob-code"] > * { | |
font-family: monospace !important; | |
} | |
} | |
@-moz-document domain("luogu.com.cn") { | |
[class*="hljs"] { | |
font-family: monospace !important; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment