Skip to content
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

fix: less #714

Merged
merged 1 commit into from
May 8, 2023
Merged

fix: less #714

merged 1 commit into from
May 8, 2023

Conversation

jc9702507
Copy link
Collaborator

  • 修改rpx问题

@github-actions
Copy link
Contributor

github-actions bot commented May 8, 2023

🎊 PR Preview c53d33b has been successfully built and deployed to https://ant-design-ant-design-mini-preview-pr-714.surge.sh

🕐 Build time: 231.401s

🤖 By surge-preview

@border-width-standard: 2 * @pixelSize; //标准
@border-width-thick: 4 * @pixelSize; //粗
@border-width-standard: 2 * @rpx; //标准
@border-width-thick: 4 * @rpx; //粗

@color-product-mask: fade(@COLOR_BLACK, @opacity-product-mask*100); //产品蒙层
@color-marketing-mask: fade(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这段代码主要定义了一些 Less 变量,来规定样式中常用的尺寸、圆角、行高、图标大小等。建议将像素单位 @pixelsize 替换为设备无关像素单位 @rpx,并适当增加一些注释以提高可读性。此外,需要注意变量的命名规范,保证易于理解和维护。

@codecov
Copy link

codecov bot commented May 8, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (ef02539) 24.02% compared to head (a4ee3e3) 24.02%.

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

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #714   +/-   ##
=======================================
  Coverage   24.02%   24.02%           
=======================================
  Files         158      158           
  Lines        3334     3334           
  Branches      875      875           
=======================================
  Hits          801      801           
  Misses       2202     2202           
  Partials      331      331           

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@border-width-standard: 2 * @pixelSize; //标准
@border-width-thick: 4 * @pixelSize; //粗
@border-width-standard: 2 * @rpx; //标准
@border-width-thick: 4 * @rpx; //粗

@color-product-mask: fade(@COLOR_BLACK, @opacity-product-mask*100); //产品蒙层
@color-marketing-mask: fade(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这段代码主要定义了一些跟界面设计相关的尺寸、颜色等变量,该部分没有明显的 bug 风险。以下是一些可以进行改进的建议:

  • 建议使用相对单位(如 rem 或 vw/vh)替代固定像素值,以适应不同屏幕大小及 DPI。
  • 可以将变量名命名规范化,统一使用横线分隔单词,并且尽可能精简命名。
  • 在 Less 中可以通过使用计算表达式减少重复定义,例如可以使用 @font-size-list 替换掉第二次出现的 @font-size-list。
  • 建议在变量定义前添加注释,表明变量的用途和默认值,方便他人理解修改。

@wyj580231 wyj580231 merged commit 4242028 into master May 8, 2023
@github-actions github-actions bot mentioned this pull request May 9, 2023
@DiamondYuan DiamondYuan deleted the fix/less branch October 27, 2023 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants