Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat(transformer): px2rem supports more options #174

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

hemengke1997
Copy link

@hemengke1997 hemengke1997 commented Feb 5, 2024

antd团队你们好,这个pr主要同步了 pxtorem@minko-fe/pxtorem 的部分逻辑

新增了一些配置项:

  1. minPixelValue,设置最小转化的px大小
  2. propList,设置可转化为rem的css属性
  3. selectorBlackList: { match, deep },黑名单相关,match用于匹配className;deep用于控制是否深度黑名单,若为true,则匹配到的类及其子类都会列入黑名单
  4. convertUnit,其目的用于转化 PX、Px 这种不规范的单位至px(并不会转rem)

由于其他的transformer都把逻辑写在同一文件中,所以此处也没有拆分代码
命名、代码风格等可能不符合antd团队规范,若有任何问题,请随意修改,谢谢!

Copy link

socket-security bot commented Feb 5, 2024

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/defu@6.1.4 None 0 19.6 kB pi0

View full report↗︎

@afc163 afc163 requested a review from MadCcc February 6, 2024 02:44
@codecov-commenter
Copy link

Codecov Report

Attention: 11 lines in your changes are missing coverage. Please review.

Comparison is base (907a22b) 94.80% compared to head (fb860ef) 94.86%.

❗ Current head fb860ef differs from pull request most recent head 5c22fda. Consider uploading reports for the commit 5c22fda to get more accurate results

Files Patch % Lines
src/transformers/px2rem.ts 95.89% 8 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #174      +/-   ##
==========================================
+ Coverage   94.80%   94.86%   +0.05%     
==========================================
  Files          29       29              
  Lines        2619     2862     +243     
  Branches      394      459      +65     
==========================================
+ Hits         2483     2715     +232     
- Misses        136      144       +8     
- Partials        0        3       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hemengke1997
Copy link
Author

请问有考虑合并吗~

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants