-
Notifications
You must be signed in to change notification settings - Fork 273
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(badge): [badge] refactor theme vars #2303
Conversation
WalkthroughThe changes involve modifications to the badge component's styling in two LESS files. In Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
packages/theme/src/badge/vars.less (1)
28-29
: LGTM! Consider adding an English comment.The addition of
--tv-Badge-margin-left
is a good improvement, allowing for more flexible positioning of badges. The naming and value are consistent with existing conventions.Consider adding an English translation of the comment for better international developer experience:
- // 标记左边距 + // 标记左边距 (Badge left margin) --tv-Badge-margin-left: var(--tv-space-sm);packages/theme/src/badge/index.less (1)
37-37
: Great refactoring of theme variables!These changes successfully introduce a customizable left margin for badges while maintaining the existing appearance of default badges. This refactoring enhances the component's flexibility without introducing breaking changes, which aligns perfectly with the PR objectives.
To ensure smooth adoption of this new feature:
- Consider updating the component's documentation to mention the new
--tv-Badge-margin-left
CSS variable.- Provide examples of how users can customize the left margin in different scenarios.
Also applies to: 65-65
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- packages/theme/src/badge/index.less (2 hunks)
- packages/theme/src/badge/vars.less (1 hunks)
🧰 Additional context used
🔇 Additional comments (2)
packages/theme/src/badge/index.less (2)
37-37
: Excellent addition of customizable left margin!The introduction of
margin-left: var(--tv-Badge-margin-left);
enhances the flexibility of the badge component. This change allows for easy customization of the left margin through a CSS variable, which is consistent with the component's theming approach and aligns well with the PR's refactoring objectives.
65-65
: Good job maintaining consistency for default badges!Setting
margin-left: 0;
for the default badge variant ensures that it maintains its original appearance without any left margin. This change effectively overrides the general margin-left property introduced earlier, preserving backwards compatibility for the default badge style. It's a thoughtful addition that complements the earlier change.
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit