Skip to content

Comments

feat(Anchor): support classNames and styles for component and ConfigProvider#52866

Merged
zombieJ merged 2 commits intonextfrom
cp-anchor
Feb 18, 2025
Merged

feat(Anchor): support classNames and styles for component and ConfigProvider#52866
zombieJ merged 2 commits intonextfrom
cp-anchor

Conversation

@thinkasany
Copy link
Member

🤔 This is a ...

  • 🆕 New feature

📝 Change Log

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

@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

👁 Visual Regression Report for PR #52866 Passed ✅

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

🎊 Congrats! No visual-regression diff found.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 18, 2025

Preview is ready

@petercat-assistant
Copy link

Walkthrough

This pull request introduces a new feature to the ConfigProvider component, enabling support for custom class names and styles for the Anchor component. This enhancement allows developers to apply specific styling and class names to different semantic parts of the Anchor, such as root, item, and title.

Changes

Files Summary
components/anchor/Anchor.tsx, components/anchor/AnchorLink.tsx Added support for classNames and styles props to customize the appearance of the Anchor component.
components/anchor/__tests__/Anchor.test.tsx Added tests to verify the new classNames and styles functionality.
components/anchor/demo/_semantic.tsx Introduced a demo showcasing the semantic DOM structure with the new styling options.
components/anchor/index.en-US.md, components/anchor/index.zh-CN.md Updated documentation to include information about the new semantic DOM feature.
components/config-provider/context.ts Updated the AnchorStyleConfig to include classNames and styles.
components/config-provider/index.en-US.md, components/config-provider/index.zh-CN.md Updated documentation to reflect changes in Anchor component configuration.

@thinkasany thinkasany mentioned this pull request Feb 18, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Feb 18, 2025

size-limit report 📦

Path Size
dist/antd.min.js 510.73 KB (+170 B 🔺)
dist/antd-with-locales.min.js 597.87 KB (+135 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@52866

commit: a4e762c

@codecov
Copy link

codecov bot commented Feb 18, 2025

Bundle Report

Changes will increase total bundle size by 1.37kB (0.04%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
antd.min-array-push 3.75MB 1.37kB (0.04%) ⬆️

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.min.js 684 bytes 2.03MB 0.03%
antd.min.js 684 bytes 1.72MB 0.04%

Files in antd-with-locales.min.js:

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

Files in antd.min.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: a4e762c
Status: ✅  Deploy successful!
Preview URL: https://8c1403eb.ant-design.pages.dev
Branch Preview URL: https://cp-anchor.ant-design.pages.dev

View logs

@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 (0c5557d) to head (a4e762c).
Report is 1 commits behind head on next.

Additional details and impacted files
@@            Coverage Diff            @@
##              next    #52866   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          766       766           
  Lines        13812     13816    +4     
  Branches      3620      3620           
=========================================
+ Hits         13812     13816    +4     

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

semantics={[
{ name: 'root', desc: locale.root, version: '6.0.0' },
{ name: 'item', desc: locale.item, version: '6.0.0' },
{ name: 'title', desc: locale.title, version: '6.0.0' },
Copy link
Member

Choose a reason for hiding this comment

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

可以加个指示器的 className,这经常被人魔改:
截屏2025-02-18 16 09 07

@zombieJ zombieJ merged commit ab4304c into next Feb 18, 2025
42 checks passed
@zombieJ zombieJ deleted the cp-anchor branch February 18, 2025 09:44
@Wxh16144 Wxh16144 changed the title feat: ConfigProvider support classnames and styles for anchor feat(Anchor): 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