-
Notifications
You must be signed in to change notification settings - Fork 3.3k
fix(badge): add type variant for dark mode contrast #3025
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile OverviewGreptile SummaryAdded a new
Confidence Score: 4.5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Dev as Developer
participant Badge as Badge Component
participant CVA as CVA Variants
participant CSS as CSS Variables
participant UI as UI (Dark Mode)
Dev->>Badge: Add variant='type' prop
Badge->>CVA: Lookup 'type' variant
CVA->>CSS: Apply bg-[var(--surface-4)]
CVA->>CSS: Apply dark:bg-[var(--surface-6)]
CSS->>UI: Light mode: #f5f5f5 (surface-4)
CSS->>UI: Dark mode: #454545 (surface-6)
UI-->>Dev: Badge visible on surface-4 header (#292929)
Note over Badge,UI: Old behavior: default variant used surface-4 in dark mode
Note over Badge,UI: New behavior: type variant uses surface-6 for contrast
|
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.
1 file reviewed, 1 comment
Additional Comments (1)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/sim/components/emcn/components/badge/badge.tsx
Line: 84:94
Comment:
TSDoc should list the new `type` variant alongside other bordered variants
```suggestion
* @remarks
* Supports two categories of variants:
* - **Bordered**: `default`, `outline`, `type` - traditional badges with borders
* - **Status colors**: `green`, `red`, `gray`, `blue`, `blue-secondary`, `purple`,
* `orange`, `amber`, `teal`, `cyan`, `gray-secondary` - borderless colored badges
*
* Status color variants can display a dot indicator via the `dot` prop.
* All variants support an optional `icon` prop for leading icons.
```
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise. |
Summary
typevariant to Badge component for better dark mode contrast on surface-4 backgroundsType of Change
Testing
Tested manually
Checklist