Skip to content

feat: Customize background colors of default & dashed buttons in disabled state#52839

Merged
thinkasany merged 12 commits intoant-design:nextfrom
yellowryan:custom-default-btn-disabled-bgcolor
Mar 13, 2025
Merged

feat: Customize background colors of default & dashed buttons in disabled state#52839
thinkasany merged 12 commits intoant-design:nextfrom
yellowryan:custom-default-btn-disabled-bgcolor

Conversation

@yellowryan
Copy link
Contributor

@yellowryan yellowryan commented Feb 15, 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

related to #52758

💡 Background and Solution

  • The specific problem to be addressed.
  • List the final API implementation and usage if needed.
  • If there are UI/interaction changes, consider providing screenshots or GIFs.

📝 Change Log

Language Changelog
🇺🇸 English Added Custom default and dashed type button background color in disabled state
🇨🇳 Chinese 新增自定义普通、虚线类型的按钮在禁用状态下的背景颜色

@bolt-new-by-stackblitz
Copy link

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

@github-actions
Copy link
Contributor

github-actions bot commented Feb 15, 2025

👁 Visual Regression Report for PR #52839 Failed ❌

🎯 Target branch: next (2eebc43)
📖 View Full Report ↗︎
📖 Alternative Report ↗︎
📊 Summary: 🆕 3 added

Expected (Branch next) Actual (Current PR) Diff
button-custom-disabled-bg.compact.png button-custom-disabled-bg.compact.png 🆕🆕🆕 Added 🆕🆕🆕
button-custom-disabled-bg.dark.png button-custom-disabled-bg.dark.png 🆕🆕🆕 Added 🆕🆕🆕
button-custom-disabled-bg.default.png button-custom-disabled-bg.default.png 🆕🆕🆕 Added 🆕🆕🆕

Important

There are 3 diffs found in this PR: 🆕 3 added.
Please check all items:

  • Visual diff is acceptable

@github-actions
Copy link
Contributor

github-actions bot commented Feb 15, 2025

Preview is ready

@petercat-assistant
Copy link

Walkthrough

This pull request introduces a new feature that allows customization of the default button's background color when it is in a disabled state. This enhancement is related to issue #52758.

Changes

Files Changed Summary
components/button/tests/index.test.tsx Added a test case to verify the customization of the default button's background color in a disabled state.
components/button/style/index.ts Updated styles to support the new background color customization for disabled default buttons.
components/button/style/token.ts Introduced a new token colorBgDefaultDisabled to manage the background color for disabled default buttons.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 15, 2025

@codecov
Copy link

codecov bot commented Feb 15, 2025

Bundle Report

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

Bundle name Size Change
antd.min-array-push 11.68MB 7.78MB (199.82%) ⬆️⚠️

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) 6.14MB 6.14MB 100.0% 🚀
antd.js (New) 5.54MB 5.54MB 100.0% 🚀
antd-with-locales.min.js (Deleted) -2.14MB 0 bytes -100.0% 🗑️
antd.min.js (Deleted) -1.76MB 0 bytes -100.0% 🗑️

Files in antd-with-locales.js:

  • ./components/button/style/token.ts → Total Size: 4.12kB

Files in antd.js:

  • ./components/button/style/token.ts → Total Size: 4.12kB

@codecov
Copy link

codecov bot commented Feb 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (2eebc43) to head (a63eb0a).
Report is 1 commits behind head on next.

Additional details and impacted files
@@            Coverage Diff            @@
##              next    #52839   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          773       773           
  Lines        13919     13921    +2     
  Branches      3650      3650           
=========================================
+ Hits         13919     13921    +2     

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

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@yellowryan yellowryan changed the title Custom default button background color in disabled state Custom default and dashed button background color in disabled state Feb 18, 2025
@yoyo837
Copy link
Contributor

yoyo837 commented Feb 22, 2025

Mabye master branch

@yellowryan yellowryan changed the base branch from feature to master February 23, 2025 05:07
@yellowryan yellowryan force-pushed the custom-default-btn-disabled-bgcolor branch from eca9cac to be601b8 Compare February 23, 2025 05:21
@yellowryan
Copy link
Contributor Author

Mabye master branch

我合并到master分支了, 麻烦看下改动是否合理哈~

@yoyo837 yoyo837 linked an issue Feb 23, 2025 that may be closed by this pull request
@yoyo837
Copy link
Contributor

yoyo837 commented Feb 23, 2025

demo需要加一下这种场景,方便生成img diff

@yellowryan
Copy link
Contributor Author

yellowryan commented Feb 23, 2025

demo需要加一下这种场景,方便生成img diff

好的,我增加一个demo

@yellowryan
Copy link
Contributor Author

demo需要加一下这种场景,方便生成img diff

好的,我增加一个demo

@yoyo837 帮忙看下这个pr看看能否合了呢 多谢~

@yoyo837
Copy link
Contributor

yoyo837 commented Feb 27, 2025

抱歉,Owner建议feature,幸苦再切回来吧

@yellowryan
Copy link
Contributor Author

抱歉,Owner建议feature,幸苦再切回来吧

ok

@yellowryan yellowryan changed the base branch from master to feature March 1, 2025 05:51
@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2025

Hi @yellowryan. Thanks for your contribution. The path .github/ or scripts/ and CHANGELOG is only maintained by team members. This current PR will be closed and team members will help on this.

Copy link

@accesslint accesslint bot left a comment

Choose a reason for hiding this comment

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

There are accessibility issues in these changes.

@yellowryan
Copy link
Contributor Author

Hi @yellowryan. Thanks for your contribution. The path .github/ or scripts/ and CHANGELOG is only maintained by team members. This current PR will be closed and team members will help on this.

@yoyo837 自动帮我close了,后续应该没啥问题了吧

@yoyo837 yoyo837 reopened this Mar 1, 2025
@yoyo837
Copy link
Contributor

yoyo837 commented Mar 1, 2025

混入了其他commit

@yellowryan
Copy link
Contributor Author

yellowryan commented Mar 5, 2025

这个visual diff前6张,我看到feature分支的表现和current pr的表现是一样的也

@yellowryan yellowryan changed the base branch from feature to next March 10, 2025 06:25
@thinkasany
Copy link
Member

对应的 PR title / changelog 可以优化一下风格,主要就是参考历史的 提交,对将来发版的大佬写 changelog 的时候会有一定帮助,未来复盘或者查看 PR 的时候也更清晰。

PR title 其实也许加一个 feat: 就够了。
changelog 可能需要再润色一下
image
image

@yellowryan yellowryan changed the title Custom default and dashed button background color in disabled state Feat: Custom default and dashed button background color in disabled state Mar 10, 2025
@yellowryan yellowryan force-pushed the custom-default-btn-disabled-bgcolor branch from 4c40976 to 8252f14 Compare March 12, 2025 06:01
@thinkasany thinkasany changed the title Feat: Custom default and dashed button background color in disabled state feat: Customize background colors of default & dashed buttons in disabled state Mar 12, 2025
@yellowryan yellowryan force-pushed the custom-default-btn-disabled-bgcolor branch from 26110fb to 5859960 Compare March 13, 2025 04:45
@yellowryan
Copy link
Contributor Author

可以合了终于

li-jia-nan
li-jia-nan previously approved these changes Mar 13, 2025
MadCcc
MadCcc previously approved these changes Mar 13, 2025
Copy link
Member

@MadCcc MadCcc left a comment

Choose a reason for hiding this comment

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

LGTM

docs: update comments

Co-authored-by: thinkasany <480968828@qq.com>
Signed-off-by: Ryan <55972954+yellowryan@users.noreply.github.com>
@yellowryan yellowryan dismissed stale reviews from MadCcc and li-jia-nan via a63eb0a March 13, 2025 06:55
@thinkasany thinkasany merged commit ec3b479 into ant-design:next Mar 13, 2025
37 of 38 checks passed
@yellowryan yellowryan deleted the custom-default-btn-disabled-bgcolor branch March 13, 2025 07:35
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.

普通按钮的禁用样式不应该与主要按钮一样

9 participants