Skip to content

Comments

feat(Breadcrumb): support classNames and styles for component and ConfigProvider#52859

Merged
zombieJ merged 5 commits intonextfrom
cp-breadcrumb
Feb 18, 2025
Merged

feat(Breadcrumb): support classNames and styles for component and ConfigProvider#52859
zombieJ merged 5 commits intonextfrom
cp-breadcrumb

Conversation

@thinkasany
Copy link
Member

🤔 This is a ...

  • 🆕 New feature

📝 Change Log

Language Changelog
🇺🇸 English feat: ConfigProvider support classnames and styles for breadcrumb
🇨🇳 Chinese feat: ConfigProvider support classnames and styles for breadcrumb

@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 18, 2025

Preview is ready

@github-actions
Copy link
Contributor

github-actions bot commented Feb 18, 2025

👁 Visual Regression Report for PR #52859 Passed ✅

🎯 Target branch: next (ed9a458)
📖 View Full Report ↗︎
📖 Alternative Report ↗︎

🎊 Congrats! No visual-regression diff found.

@petercat-assistant
Copy link

  • Walkthrough: This PR introduces support for custom class names and styles in the Breadcrumb component through the ConfigProvider. It leverages a new BreadcrumbContext to manage these styles and class names, allowing for more flexible and customizable breadcrumb styling.
  • Changes:
    Files Summary
    Breadcrumb.tsx, BreadcrumbItem.tsx, BreadcrumbSeparator.tsx Added support for custom class names and styles using BreadcrumbContext.
    BreadcrumbContext.ts Introduced a new context for managing breadcrumb styles and class names.
    Breadcrumb.test.tsx Added tests for the new class names and styles feature.
    context.ts Updated to include BreadcrumbConfig for class names and styles.
    index.en-US.md, index.zh-CN.md Documentation updates for the new feature.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 18, 2025

size-limit report 📦

Path Size
dist/antd.min.js 509.67 KB (-571 B 🔽)
dist/antd-with-locales.min.js 596.38 KB (-318 B 🔽)

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 18, 2025

Open in Stackblitz

More templates

npm i https://pkg.pr.new/ant-design/ant-design/antd@52859

commit: f08f684

@codecov
Copy link

codecov bot commented Feb 18, 2025

Bundle Report

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

Bundle name Size Change
antd.min-array-push 11.66MB 7.91MB (210.69%) ⬆️⚠️

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.08MB 6.08MB 100.0% 🚀
antd.js (New) 5.58MB 5.58MB 100.0% 🚀
antd-with-locales.min.js (Deleted) -2.03MB 0 bytes -100.0% 🗑️
antd.min.js (Deleted) -1.72MB 0 bytes -100.0% 🗑️

Files in antd-with-locales.js:

  • ./components/config-provider/context.ts → Total Size: 1.51kB

Files in antd.js:

  • ./components/config-provider/context.ts → Total Size: 1.51kB

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 18, 2025

Deploying ant-design with  Cloudflare Pages  Cloudflare Pages

Latest commit: f08f684
Status: ✅  Deploy successful!
Preview URL: https://6d7b0d55.ant-design.pages.dev
Branch Preview URL: https://cp-breadcrumb.ant-design.pages.dev

View logs

@thinkasany thinkasany mentioned this pull request Feb 18, 2025
@codecov
Copy link

codecov bot commented Feb 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (ed9a458) to head (f08f684).
Report is 1 commits behind head on next.

Additional details and impacted files
@@            Coverage Diff            @@
##              next    #52859   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          765       766    +1     
  Lines        13803     13812    +9     
  Branches      3620      3620           
=========================================
+ Hits         13803     13812    +9     

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

return cloneElement(element, (oriProps) => ({
separator: isLastItem ? '' : separator,
className: classNames(oriProps?.className, mergedClassNames?.item),
style: { ...mergedStyles?.item, ...oriProps?.style },
Copy link
Member

Choose a reason for hiding this comment

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

不太对,item 的位置应该是 li 不是里面的东西。BreadcrumbItem 的 render 会额外多包一层,所以这个直接传下去的位置是不对的:
截屏2025-02-18 11 11 34

@zombieJ zombieJ merged commit b411c27 into next Feb 18, 2025
42 checks passed
@zombieJ zombieJ deleted the cp-breadcrumb branch February 18, 2025 06:34
@Wxh16144 Wxh16144 changed the title feat: ConfigProvider support classnames and styles for breadcrumb feat(Breadcrumb): support classNames and styles for component and ConfigProvider Nov 28, 2025
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