DouyinFE / semi-design

🚀A modern, comprehensive, flexible design system and React UI library. 🎨 Provide more than 3000+ Design Tokens, easy to build your design system. Make Semi Design to Any Design. 🧑🏻‍💻 Design to Code in one click
https://semi.design
Other
8.47k stars 716 forks source link

fix: Incorrect suffix position calculation when Typography strong attribute is true #2506

Closed pandoralink closed 1 month ago

pandoralink commented 1 month ago

…ribute is true

中文模板 / Chinese Template

What kind of change does this PR introduce? (check at least one)

PR description

ellipsisContainer 无法准确获取宽度。原因是最终渲染形式为 <strong><span /></strong>,而实际计算基于 <span></span>。若 ellipsisContainer 能够主动传入 fontWeight 或者在计算时包裹一层 <strong> 标签,便可实现准确计算。此外,部分字体的 fontWeight 对宽度影响较为显著。 复现链接 codesandbox

Changelog

🇨🇳 Chinese


🇺🇸 English

Checklist

Other

Additional information

codesandbox-ci[bot] commented 1 month ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit accc5c00dfbcd0a86db40b27ead66aedf3a5c3a4:

Sandbox Source
pr-story Configuration
pandoralink commented 1 month ago

解除了 codesandbox 的查看权限

YyumeiZhang commented 1 month ago

@pandoralink 感谢PR,由于 strong 类型时候,font-weight 为 600,我这边修改成如果是 strong 类型,将容器的 font-weight 设置为 600

cypress[bot] commented 1 month ago

semi-design    Run #2849

Run Properties:  status check passed Passed #2849  •  git commit 351eec71d0: fix: Incorrect suffix position calculation when Typography strong attribute is t...
Project semi-design
Branch Review main
Run status status check passed Passed #2849
Run duration 07m 59s
Commit git commit 351eec71d0: fix: Incorrect suffix position calculation when Typography strong attribute is t...
Committer pandoralink
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 11
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 264
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.
View all changes introduced in this branch ↗︎