-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
feat(lint): disallow unexpected font-family from sketch #11001
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
Size Change: +199 B (0%) Total Size: 9.85 MB
ℹ️ View Unchanged
|
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## master #11001 +/- ##
=======================================
Coverage 29.21% 29.21%
=======================================
Files 478 478
Lines 14370 14370
Branches 3384 3384
=======================================
Hits 4198 4198
Misses 9445 9445
Partials 727 727
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
'PingFangSC-Bold', | ||
"'PingFangSC-Bold'", | ||
], | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
用户如果配置 declaration-property-value-disallowed-list 的其他属性,会合并么?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
试了下,内置的这条会被用户的配置覆盖掉 👀
有用,但是没必要放入默认持续集成,umi大部分场景是用在中后台,chrome,环境很单一。 |
改动内容
禁止意外的
font-family
配置,比如font-family: PingFangSC;
改动原因
这类
font-family
配置通常是来源于从 Sketch 中复制的 CSS 样式,单一的font-family
会导致在没有该字体的设备上渲染异常,比如可能会兜底到宋体之类的衬线字体做渲染触发规则后的解法
如果是基于 antd 或其他 UI 框架的项目,请直接移除该
font-family
代码,因为大多数 UI 框架都已经预设了font-family
配置,ref antd:https://github.com/ant-design/ant-design/blob/master/components/style/reset.css#L17如果是不使用任何 UI 框架的项目且有
font-family
的配置需求,请设置至少一个兜底规则,例如font-family: PingFangSC, sans-serif;
表示在找不到字体时兜底到该设备默认的非衬线字体cc @afc163