Comments (4)
可能应该通过投票来决定输出结果的顺序.
当我们收集了足够数量的投票, 就可以决定最终的行为, 投票截止日期待定.
认为Appoint Font的输出应该与CSS规则的顺序一致的, 请在这条评论上添加👍.
认为Appoint Font的输出应该与CSS规则的顺序相反的, 请在这条评论上添加👎.
from appoint-font.
这是因为Appoint Font的规则顺序与生成的CSS @font-face
规则顺序一致.
考虑以下代码:
<!DOCTYPE html>
<html>
<head>
<style>
body {
font-family: 微软雅黑;
}
@font-face {
font-family: 微软雅黑;
src: local("Fira Code");
}
@font-face {
font-family: 微软雅黑;
src: local("Noto Serif CJK SC");
}
</style>
</head>
<body>
我能吞下玻璃而不伤身体.
</body>
</html>
在这种情况下, 浏览器只加载Noto Serif CJK SC, 因为它是最后一条匹配上的规则.
再看另一种顺序:
<!DOCTYPE html>
<html>
<head>
<style>
body {
font-family: 微软雅黑;
}
@font-face {
font-family: 微软雅黑;
src: local("Noto Serif CJK SC");
}
@font-face {
font-family: 微软雅黑;
src: local("Fira Code");
}
</style>
</head>
<body>
我能吞下玻璃而不伤身体.
</body>
</html>
在这种情况下, 浏览器同时加载Noto Serif CJK SC和Fira Code.
对比上一段代码, 可以发现浏览器首先尝试了Fira Code, 然后又加载了Noto Serif CJK SC来补充Fira Code缺失的部分.
所以你看到的行为是"正确"的, 至少在CSS规则的顺序上是正确的.
这里的分歧是Appoint Font是否应该以与CSS规则相反的顺序输出规则.
我很可能被CSS的相关知识诅咒了, 因为我觉得当前的输出顺序是可以接受的, 而其他人则会认为反过来才符合逻辑.
from appoint-font.
这是因为Appoint Font的规则顺序与生成的CSS
@font-face
规则顺序一致.考虑以下代码:
<!DOCTYPE html> <html> <head> <style> body { font-family: 微软雅黑; } @font-face { font-family: 微软雅黑; src: local("Fira Code"); } @font-face { font-family: 微软雅黑; src: local("Noto Serif CJK SC"); } </style> </head> <body> 我能吞下玻璃而不伤身体. </body> </html>
在这种情况下, 浏览器只加载Noto Serif CJK SC, 因为它是最后一条匹配上的规则.
再看另一种顺序:
<!DOCTYPE html> <html> <head> <style> body { font-family: 微软雅黑; } @font-face { font-family: 微软雅黑; src: local("Noto Serif CJK SC"); } @font-face { font-family: 微软雅黑; src: local("Fira Code"); } </style> </head> <body> 我能吞下玻璃而不伤身体. </body> </html>
在这种情况下, 浏览器同时加载Noto Serif CJK SC和Fira Code. 对比上一段代码, 可以发现浏览器首先尝试了Fira Code, 然后又加载了Noto Serif CJK SC来补充Fira Code缺失的部分.
所以你看到的行为是"正确"的, 至少在CSS规则的顺序上是正确的. 这里的分歧是Appoint Font是否应该以与CSS规则相反的顺序输出规则. 我很可能被CSS的相关知识诅咒了, 因为我觉得当前的输出顺序是可以接受的, 而其他人则会认为反过来才符合逻辑.
确实如果按照css的规则来看,这个结果是正确的,但也并不是所有人都懂css。其实可以不改变代码逻辑,在插件界面上,或者插件说明中,解释一下匹配的规则或者直接教一下如何选择,既可以消除歧义,也让大家对新功能有一个新的认识,毕竟之前只有2个下拉框,现在有这么多自定义的选项,可能大家都不太会用。当然也可以保留投票等待投票结果~
最后还是感谢大佬的开发,这个插件比任何替换字体的插件都好用!
from appoint-font.
可能应该通过投票来决定输出结果的顺序. 当我们收集了足够数量的投票, 就可以决定最终的行为, 投票截止日期待定.
认为Appoint Font的输出应该与CSS规则的顺序一致的, 请在这条评论上添加👍. 认为Appoint Font的输出应该与CSS规则的顺序相反的, 请在这条评论上添加👎.
在不懂 css 的情况下,我的直觉让我认为是在前面的先匹配,后面的做补充。我是不是应该点 👎?
from appoint-font.
Related Issues (20)
- Manifest V3版本路线图 HOT 5
- 字体列表性能优化 HOT 2
- [Microsoft Edge] The size of options is too small HOT 2
- 360极速浏览器X(内核版本95)无法选择自定义字体。 HOT 1
- 关于某些页面上继承自body或html的字体样式 HOT 11
- 新版本 2023.0.4 在新版微博网页版失效 HOT 1
- 360安全浏览器最新版本,该插件规则设置无效。 HOT 1
- 请问该插件是否在 linux 下的 Chrome 浏览器中无效? HOT 2
- 是否会导致fontawesome字体失灵? HOT 1
- 知乎部分文字的字重被改变了 HOT 2
- 360安全浏览器15,Chromium114内核;360极速浏览器X64位正式版,Chromium119内核。这俩无效呀。 HOT 2
- 请求支持在插件 icon 的点击弹窗中修改规则 HOT 3
- font-family里system-ui一项导致自定义字体不生效 HOT 2
- 在Google Earth和Google Calendar上有明显性能损失 HOT 1
- 尝试适配字体字重
- 支持为不同网页单独设定字体
- 支持字体精确匹配到语言
- chrome更新后插件无效了 HOT 1
- 设置等宽字体为SF Mono时不生效 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from appoint-font.