🐛 fix: Replaced hardcoded colors in ReplaceCardModal and CodeBlock with theme tokens.#1497
🐛 fix: Replaced hardcoded colors in ReplaceCardModal and CodeBlock with theme tokens.#1497gulshank0 wants to merge 3 commits intokubestellar:mainfrom
Conversation
…th theme tokens Signed-off-by: gulshank0 <gulshanbahadur002@gmail.com>
❌ Deploy Preview for kubestellarconsole failed. Why did it fail? →
|
|
👋 Hey @gulshank0 — thanks for opening this PR!
This is an automated message. |
|
Welcome to KubeStellar! 🚀 Thank you for submitting this Pull Request. Before your PR can be merged, please ensure: ✅ DCO Sign-off - All commits must be signed off with ✅ PR Title - Must start with an emoji: ✨ (feature), 🐛 (bug fix), 📖 (docs), 🌱 (infra/tests), Getting Started with KubeStellar: Contributor Resources:
🌟 Help KubeStellar Grow - We Need Adopters! Our roadmap is driven entirely by adopter feedback. Whether you're using KubeStellar yourself or know someone who could benefit from multi-cluster Kubernetes: 📋 Take our Multi-Cluster Survey - Share your use cases and help shape our direction! A maintainer will review your PR soon. Feel free to ask questions in the comments or on Slack! |
There was a problem hiding this comment.
Pull request overview
This PR aims to remove hardcoded Tailwind palette colors from two UI components so they adapt correctly to light/dark theme switching.
Changes:
- Updated
ReplaceCardModalcategory badge styling to use semantic theme tokens. - Updated
CodeBlockdark-theme text and button colors to use theme tokens (partial). - Kept specified opacity modifiers (
/50,/80) in the updated classes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| web/src/components/ui/CodeBlock.tsx | Swaps some dark-mode gray-* classes for theme tokens, but still leaves several hardcoded gray-* classes in the component. |
| web/src/components/dashboard/ReplaceCardModal.tsx | Replaces slate-* badge styles with theme tokens for better theme compatibility. |
| <button | ||
| onClick={handleCopy} | ||
| className="p-1.5 rounded bg-gray-200/80 dark:bg-gray-800/80 hover:bg-gray-300/80 dark:hover:bg-gray-700/80 transition-colors" | ||
| className="p-1.5 rounded bg-gray-200/80 dark:bg-secondary/80 hover:bg-gray-300/80 dark:hover:bg-accent/80 transition-colors" |
There was a problem hiding this comment.
This button styling still contains hardcoded light-theme grays (bg-gray-200/80 and hover:bg-gray-300/80). That conflicts with the stated goal / issue acceptance criteria of removing gray-*/slate-* classes from this component. Switch these remaining light-mode color classes to the equivalent theme tokens (and consider removing the dark: variants once both themes use tokens).
| <AlertCircle className="w-4 h-4 text-red-500 dark:text-red-400" /> | ||
| ) : ( | ||
| <Copy className="w-4 h-4 text-gray-600 dark:text-gray-400" /> | ||
| <Copy className="w-4 h-4 text-gray-600 dark:text-muted-foreground" /> |
There was a problem hiding this comment.
The copy icon still uses a hardcoded text-gray-600 color in light theme, which violates the requirement to remove gray-* classes from this file. Replace it with an appropriate semantic token (e.g., text-muted-foreground/text-foreground) so it adapts to theme changes.
| <pre className={`bg-gray-100 dark:bg-gray-900 border border-gray-200 dark:border-gray-800 rounded-md p-4 overflow-x-auto ${fontSize === 'lg' ? 'text-sm' : fontSize === 'base' ? 'text-xs' : 'text-[11px]'}`}> | ||
| <code className={`language-${language} text-gray-800 dark:text-gray-300 font-mono`}> | ||
| <code className={`language-${language} text-gray-800 dark:text-foreground/80 font-mono`}> |
There was a problem hiding this comment.
The <pre>/<code> block still has multiple hardcoded gray classes (bg-gray-100, dark:bg-gray-900, border-gray-200, dark:border-gray-800, text-gray-800). This prevents full theme-token adoption and fails the “no gray-*/slate-* classes” acceptance criteria for this file. Replace these with semantic tokens (e.g., bg-muted/bg-secondary, border-border, text-foreground with the desired opacity) so both light and dark themes are handled via tokens.
| </div> | ||
| <p className="text-xs text-muted-foreground line-clamp-2">{cardType.description}</p> | ||
| <span className="inline-block mt-1 text-[10px] text-slate-500 bg-slate-800/50 px-1.5 py-0.5 rounded">{cardType.category}</span> | ||
| <span className="inline-block mt-1 text-[10px] text-muted-foreground bg-secondary/50 px-1.5 py-0.5 rounded">{cardType.category}</span> |
There was a problem hiding this comment.
The issue description for #1322 specifies bg-secondary (no opacity) for this badge background, but the change uses bg-secondary/50. Please confirm which is intended and align either the implementation or the issue/PR description so the acceptance criteria are unambiguous.
clubanderson
left a comment
There was a problem hiding this comment.
1495 🐛 fix: Replaced hardcoded gray/slate colors in WidgetExportModal with theme tokens. gulshank0
1410 🐛 fix(auth): replace hardcoded colors in Login.tsx with theme-aware tokens arnavgogia20
1380 ✨: add Metal3 monitoring card to KubeStellar Console aaradhychinche-alt
clubanderson
left a comment
There was a problem hiding this comment.
Review: Incomplete theme token migration
The dark-mode conversions look correct, but this PR doesn't satisfy the acceptance criteria from #1322:
No hardcoded
gray-orslate-color classes remain in either file
Remaining hardcoded colors in CodeBlock.tsx:
bg-gray-200/80→ should bebg-secondary/80hover:bg-gray-300/80→ should behover:bg-accent/80text-gray-600→ should betext-muted-foregroundbg-gray-100→ should bebg-secondaryborder-gray-200→ should beborderdark:bg-gray-900→ should bedark:bg-secondarydark:border-gray-800→ should bedark:bordertext-gray-800→ should betext-foreground
Please convert ALL light and dark mode hardcoded colors to theme tokens. The PR currently only converts ~4 of the ~12 hardcoded values.
|
@gulshank0 Thanks for the contribution! The dark-mode token swaps look good, but there are still ~8 hardcoded |
Signed-off-by: gulshank0 <gulshanbahadur002@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Signed-off-by: gulshank0 <gulshanbahadur002@gmail.com>
clubanderson
left a comment
There was a problem hiding this comment.
1410 🐛 fix(auth): replace hardcoded colors in Login.tsx with theme-aware tokens arnavgogia20
1380 ✨: add Metal3 monitoring card to KubeStellar Console aaradhychinche-alt
…Block (kubestellar#1322) - Replaced ALL hardcoded gray/slate values - Covered both light and dark mode tokens - Preserved opacity modifiers (/50, /80) - Maintained code readability with text-foreground/80 - Addresses incomplete migration in kubestellar#1497 Fixes kubestellar#1322 Signed-off-by: arnavgogia20 <arnavgogia404@gmail.com>
…Block (kubestellar#1322) - Replaced ALL hardcoded gray/slate values - Covered both light and dark mode tokens - Preserved opacity modifiers (/50, /80) - Maintained code readability with text-foreground/80 - Addresses incomplete migration in kubestellar#1497 Fixes kubestellar#1322 Signed-off-by: arnavgogia20 <arnavgogia404@gmail.com>
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
👋 @gulshank0 — thank you for this contribution! Closing in favor of #1527 by @arnavgogia20 which addresses the same issue (#1322) with more complete coverage (including the light-mode values that were unconverted here). We really appreciate you taking the time to work on this. Please consider picking up another issue — there are many |
…Block (#1322) (#1527) - Replaced ALL hardcoded gray/slate values - Covered both light and dark mode tokens - Preserved opacity modifiers (/50, /80) - Maintained code readability with text-foreground/80 - Addresses incomplete migration in #1497 Fixes #1322 Signed-off-by: arnavgogia20 <arnavgogia404@gmail.com>
📌 Fixes
Fixes #1322
📝 Summary of Changes
In web/src/components/dashboard/ReplaceCardModal.tsx:
In web/src/components/ui/CodeBlock.tsx:
Changes Made
Checklist
Please ensure the following before submitting your PR:
Screenshots or Logs (if applicable)
👀 Reviewer Notes
Add any special notes for the reviewer here