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: Collapse support cssVar #45862
Conversation
Run & review this pull request in StackBlitz Codeflow. |
size-limit report 📦
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
lint 看下 |
我看看 |
bd72f1f
to
b5e882c
Compare
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 1c2fdef:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feature #45862 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 706 706
Lines 12078 12079 +1
Branches 3197 3197
=========================================
+ Hits 12078 12079 +1 ☔ View full report in Codecov by Sentry. |
components/collapse/style/index.ts
Outdated
@@ -95,7 +100,7 @@ export const genBaseStyle: GenerateStyle<CollapseToken> = (token) => { | |||
alignItems: 'flex-start', | |||
padding: headerPadding, | |||
color: colorTextHeading, | |||
lineHeight, | |||
lineHeight: lineHeightLG, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里不用改哦,应该是 large 的 Collapse 才需要改
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
Co-authored-by: MadCcc <madccc@foxmail.com> Signed-off-by: 红果汁 <pingfj77@gmail.com>
Co-authored-by: MadCcc <madccc@foxmail.com> Signed-off-by: 红果汁 <pingfj77@gmail.com>
b7cdb79
to
7c9645c
Compare
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
💡 Background and solution
📝 Changelog
☑️ Self-Check before Merge
🚀 Summary
🤖 Generated by Copilot at 804ab6b
This pull request refactors the Collapse component to use CSS variables for styling, improving the code quality and maintainability. It introduces a new
useCSSVar
hook incomponents/collapse/style/cssVar.ts
that registers and applies the CSS variables dynamically. It also simplifies the style code incomponents/collapse/style/index.ts
by using utility functions and properties from the theme module.🔍 Walkthrough
🤖 Generated by Copilot at 804ab6b
useCSSVar
hook to register and apply CSS variables for Collapse component (link, link, link, link)unit
function to ensure consistent units for CSS variables and style properties (link, link, link, link)token.calc
method to simplify margin calculations (link, link)fontHeight
property to simplify height settings (link, link)prepareComponentToken
function to generate default token values for Collapse component (link, link)