Skip to content

fix: update genStyleUtils to correct linkStyle#52888

Merged
afc163 merged 3 commits intoant-design:masterfrom
DDDDD12138:fix-update-genstyleutils-linkstyle
Feb 20, 2025
Merged

fix: update genStyleUtils to correct linkStyle#52888
afc163 merged 3 commits intoant-design:masterfrom
DDDDD12138:fix-update-genstyleutils-linkstyle

Conversation

@DDDDD12138
Copy link
Copy Markdown
Contributor

@DDDDD12138 DDDDD12138 commented Feb 19, 2025

中文版模板 / Chinese template

🤔 This is a ...

  • 🆕 New feature
  • 🐞 Bug fix
  • 📝 Site / documentation improvement
  • 📽️ Demo improvement
  • 💄 Component style improvement
  • 🤖 TypeScript definition improvement
  • 📦 Bundle size optimization
  • ⚡️ Performance optimization
  • ⭐️ Feature enhancement
  • 🌐 Internationalization
  • 🛠 Refactoring
  • 🎨 Code style optimization
  • ✅ Test Case
  • 🔀 Branch merge
  • ⏩ Workflow
  • ❓ Other (about what?)

🔗 Related Issues

fix: #52879

💡 Background and Solution

Add styles to ensure that the basic a tag styles can be applied when the a tag is already the outermost antd component element.

example: a:where(.css-dev-only-do-not-override-xxxx)

📝 Change Log

Language Changelog
🇺🇸 English Fixed button hyperlink style
🇨🇳 Chinese 修复按钮超链接样式

@bolt-new-by-stackblitz
Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 19, 2025

👁 Visual Regression Report for PR #52888 Passed ✅

🎯 Target branch: master (444f579)
📖 View Full Report ↗︎
📖 Alternative Report ↗︎

🎊 Congrats! No visual-regression diff found.

@petercat-assistant
Copy link
Copy Markdown

Walkthrough

This pull request addresses a bug fix by updating the genStyleUtils to correct the link style. The change involves removing an unnecessary & wrapper to prevent nested selectors, which impacts the button hyperlink style.

Changes

File Summary
components/theme/util/genStyleUtils.ts Removed the & wrapper from genLinkStyle to prevent unnecessary nested selectors, ensuring correct link styling.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 19, 2025

Preview is ready

Comment thread components/theme/util/genStyleUtils.ts Outdated
},
getResetStyles: (token, config) => [
{ '&': genLinkStyle(token) },
genLinkStyle(token),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The removal of the & wrapper from genLinkStyle is a crucial fix to avoid unnecessary nested selectors, which could lead to incorrect styling of links. This change ensures that the link styles are applied correctly without additional nesting.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Feb 19, 2025

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 19, 2025

Bundle Report

Changes will increase total bundle size by 6.26MB (185.07%) ⬆️⚠️, exceeding the configured threshold of 5%.

Bundle name Size Change
antd.min-array-push 9.64MB 6.26MB (185.07%) ⬆️⚠️

Affected Assets, Files, and Routes:

view changes for bundle: antd.min-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
antd-with-locales.js (New) 5.07MB 5.07MB 100.0% 🚀
antd.js (New) 4.57MB 4.57MB 100.0% 🚀
antd-with-locales.min.js (Deleted) -1.84MB 0 bytes -100.0% 🗑️
antd.min.js (Deleted) -1.54MB 0 bytes -100.0% 🗑️

Files in antd-with-locales.js:

  • ./components/theme/util/genStyleUtils.ts → Total Size: 1.32kB

Files in antd.js:

  • ./components/theme/util/genStyleUtils.ts → Total Size: 1.32kB

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (444f579) to head (a20d050).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #52888   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          768       768           
  Lines        13847     13849    +2     
  Branches      3629      3629           
=========================================
+ Hits         13847     13849    +2     

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

@thinkasany
Copy link
Copy Markdown
Member

thinkasany commented Feb 19, 2025

diff 看起来不太对,anchor 那些全都加上下划线了。https://antd-visual-diff.oss-accelerate.aliyuncs.com/pr-52888/visualRegressionReport/report.html
image
image

@DDDDD12138
Copy link
Copy Markdown
Contributor Author

diff 看起来不太对,anchor 那些全都加上下划线了。

哦,我的,我下午回去检查一下

@DDDDD12138 DDDDD12138 closed this Feb 19, 2025
@DDDDD12138 DDDDD12138 reopened this Feb 19, 2025
@afc163 afc163 merged commit 8ecdc72 into ant-design:master Feb 20, 2025
@thinkasany
Copy link
Copy Markdown
Member

@DDDDD12138
🎉 Thank you for your contribution! If you have not yet joined our DingTalk community group, please feel free to join us (when joining, please provide the link to this PR).
🎉 感谢您的贡献!如果您还没有加入钉钉社区群,请扫描下方二维码加入我们(加群时请提供此 PR 链接)。

@PeachScript PeachScript mentioned this pull request Feb 24, 2025
16 tasks
renny-ren pushed a commit to renny-ren/ant-design that referenced this pull request Apr 14, 2025
* fix: update genStyleUtils to correct linkStyle

* feat: compatible with the "a" tag inside the element

---------

Co-authored-by: thinkasany <480968828@qq.com>
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.

Button with an href has different styles depending on its position

3 participants