Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: tabs support cssVar #45803

Merged
merged 4 commits into from
Nov 13, 2023
Merged

feat: tabs support cssVar #45803

merged 4 commits into from
Nov 13, 2023

Conversation

kiner-tang
Copy link
Member

@kiner-tang kiner-tang commented Nov 11, 2023

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Workflow
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English tabs support css variable theme
🇨🇳 Chinese 标签页支持 css 变量主题

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

🚀 Summary

🤖 Generated by Copilot at 0fd6677

This pull request enhances the tabs component with CSS variables support and refactors its style code. It adds custom hooks and a provider component to enable dynamic theming and customization of the tabs component and its dropdown menu. It also improves the consistency and compatibility of the CSS variables and calculations by using the @ant-design/cssinjs package and extracting common functions to separate files.

🔍 Walkthrough

🤖 Generated by Copilot at 0fd6677

  • Import and use custom hooks for registering and applying CSS variables for the tabs component (link, link, link, link, link, link)
  • Wrap numeric token values with the unit function to convert them to CSS units (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)
  • Replace some token values with the token.calc function to create CSS calculation expressions (link, link)
  • Add a new token property tabsCardLineHeight to the ComponentToken interface (link)
  • Replace the token.cardPadding value with the token.tabsCardPadding value, which is calculated from the token.cardPadding value if it is empty (link)
  • Update the imports in the style/index.ts file, replacing the FullToken type with the GetDefaultToken type and removing the genComponentStyleHook import (link)
  • Simplify the genComponentStyleHook function call by using the prepareComponentToken function instead of a function expression (link)

Copy link

stackblitz bot commented Nov 11, 2023

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

Copy link
Contributor

github-actions bot commented Nov 11, 2023

Preview Is ready

Copy link
Contributor

github-actions bot commented Nov 11, 2023

size-limit report 📦

Path Size
./dist/antd.min.js 404.09 KB (+84 B 🔺)
./dist/antd-with-locales.min.js 463.52 KB (+86 B 🔺)

Copy link

codesandbox-ci bot commented Nov 11, 2023

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 116623e:

Sandbox Source
antd reproduction template (forked) Configuration

Copy link

codecov bot commented Nov 11, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (047bc53) 100.00% compared to head (116623e) 100.00%.
Report is 7 commits behind head on feature.

Additional details and impacted files
@@            Coverage Diff             @@
##           feature    #45803    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files          706       706            
  Lines        12015     12190   +175     
  Branches      3202      3236    +34     
==========================================
+ Hits         12015     12190   +175     
Files Coverage Δ
components/tabs/index.tsx 100.00% <100.00%> (ø)
components/tabs/style/index.ts 100.00% <100.00%> (ø)

... and 11 files with indirect coverage changes

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

)}
popupClassName={classNames(popupClassName, hashId)}
popupClassName={classNames(popupClassName, hashId, rootCls)}
Copy link
Member

Choose a reason for hiding this comment

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

这里没有 rootClassName 么

Copy link
Member Author

Choose a reason for hiding this comment

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

以前是没有的

Co-authored-by: MadCcc <madccc@foxmail.com>
Signed-off-by: kiner-tang(文辉) <1127031143@qq.com>
@MadCcc MadCcc merged commit fc62994 into feature Nov 13, 2023
92 checks passed
@MadCcc MadCcc deleted the feat/css-variable-theme-tabs branch November 13, 2023 06:18
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.

None yet

2 participants