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
refactor: use token instead of constant in size #44598
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Run & review this pull request in StackBlitz Codeflow. |
size-limit report 📦
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
li-jia-nan
commented
Sep 2, 2023
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## feature #44598 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 678 679 +1
Lines 11430 11444 +14
Branches 3078 3083 +5
=========================================
+ Hits 11430 11444 +14
☔ View full report in Codecov by Sentry. |
zombieJ
reviewed
Sep 2, 2023
zombieJ
reviewed
Sep 2, 2023
zombieJ
reviewed
Sep 3, 2023
zombieJ
reviewed
Sep 4, 2023
zombieJ
reviewed
Sep 4, 2023
zombieJ
reviewed
Sep 4, 2023
zombieJ
reviewed
Sep 4, 2023
zombieJ
reviewed
Sep 4, 2023
zombieJ
approved these changes
Sep 4, 2023
This was referenced Oct 9, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
💡 Background and solution
📝 Changelog
size
not following design token and Compact theme will now correct handle space gap value.size
不会跟随 Design Token 的问题,现在紧凑模式也会正确处理对应的间距数值。☑️ Self-Check before Merge
🚀 Summary
🤖 Generated by Copilot at 38d2448
The pull request refactors and improves the
Space
component and its related files. It uses logical properties and CSS variables to handle different spacing sizes and writing directions, adds custom token support for thesize
prop, and fixes some test cases and code style issues.🔍 Walkthrough
🤖 Generated by Copilot at 38d2448
SpaceContextType
interface and use it for type annotation incontext.ts
andItem.tsx
(link, link, link, link)marginRight
andmarginLeft
withmarginInlineStart
inItem.tsx
and update test cases inindex.test.tsx
to support RTL layouts (link, link, link, link)horizontalSize
andverticalSize
fromsize
prop inindex.tsx
and use them asrowGap
andcolumnGap
values or class names (link, link, link)marginDirection
prop and variable fromindex.tsx
andItem.tsx
as they are no longer needed (link, link, link, link)rowGap
andcolumnGap
and usemergeToken
function to merge them with default values instyle/index.tsx
(link, link, link)genSpaceGapStyle
function to generate style rules for preset sizes ofrowGap
andcolumnGap
instyle/index.tsx
(link)index.test.tsx
andstyle/compact.tsx
to follow code style convention (link, link)demo/base.tsx
andindex.tsx
to follow code style convention (link, link)style
prop inindex.tsx
to follow code style convention (link)items
variable for readability inindex.test.tsx
(link, link)