Skip to content

Replace hardcoded hex colors with Tailwind design tokens - #29

Open
AakashKB wants to merge 2 commits into
10xapp:mainfrom
AakashKB:fix/replace-hardcoded-colors-with-tokens
Open

Replace hardcoded hex colors with Tailwind design tokens#29
AakashKB wants to merge 2 commits into
10xapp:mainfrom
AakashKB:fix/replace-hardcoded-colors-with-tokens

Conversation

@AakashKB

@AakashKB AakashKB commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replace hardcoded hex color values with their exact-match Tailwind design tokens from core-web/src/index.css
  • Only changes colors that are an exact match to an existing token
  • 7 component files updated across Chat, Calendar, Dropdown, and Landing

Token replacements made

Hex Token Files
#FFFFFF var(--color-bg-white) Dropdown, DraggableEventBlock, AllDayEventsSection, MonthView
#EAEAEA bg-border-light StreamingText, ContentPartsRenderer
#E7E7E6 var(--color-border-gray) / border-border-gray Dropdown, LandingPage
#F4F3F1 bg-gray-50 LandingPage
#00000054 text-text-tertiary LandingPage

Remaining hardcoded colors (no exact token match)

These were intentionally skipped, the closest token is listed but none are exact matches. Would it make sense to add new tokens to the theme for these, or adjust existing ones?

Hex Used in Closest token Token value Notes
#F4F4F4 ChatMessage, BuilderChat, LandingPage --color-bg-gray #F4F3F1 ~3 off
#FCFCFC ChatView, ContentPartsRenderer, Calendar --color-bg-light #FDFDFD ~1 off
#F9F9F9 OnboardingWizard, KanbanColumn, LandingPage --color-bg-shell #F6F6F6 ~3 off
#F7F8FA SidebarChatMessage, AgentChatInput, AgentChatMessage --color-bg-light #FDFDFD ~5 off, blue tint
#F8F8FA BuilderPreview --color-bg-light #FDFDFD ~5 off, blue tint
#FAFAFA AgentConfigPanel --color-bg-light #FDFDFD ~3 off
#F0F1F3 KanbanColumn (hover) --color-gray-100 #E7E7E6 ~10 off, no close match
#E3E3E5 Sidebar, OnboardingSidebarPreview, LandingPage --color-bg-gray-dark #E5E7EB ~4 off
#1e1e1e StreamingText, ContentPartsRenderer (code blocks) --color-bg-dark #000000 ~30 off, needs a --color-bg-code token
#2d2d2d ContentPartsRenderer (code header) --color-gray-800 #3D3D3C ~16 off, needs a --color-bg-code-header token
#323232 Sidebar, MiniAppHeader (icon text) --color-gray-800 #3D3D3C ~11 off
#000 LandingPage (text) --color-text-dark #000000 exact shorthand, but in demo content

Test plan

  • Verify Dropdown renders with same white background and gray border
  • Verify inline code in chat messages has same light gray background
  • Verify calendar events with outlined style show white background
  • Verify Landing page demo UI looks unchanged

Closes #11

Summary by CodeRabbit

  • Style
    • Standardized colors across the app using theme tokens for improved visual consistency and theming
    • Updated calendar event and RSVP outlined appearances for consistent backgrounds
    • Improved code block and inline code styling in chat messages
    • Refined dropdown, timeline, landing page, sidebar, and onboarding preview palettes
    • Harmonized chat/agent/mini-app input and bubble backgrounds and Kanban column hover states

@coderabbitai

coderabbitai Bot commented Apr 1, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 90259d3a-f039-41d7-b491-f3096bdc548d

📥 Commits

Reviewing files that changed from the base of the PR and between ac4bf0a and 1fdfc19.

📒 Files selected for processing (19)
  • core-web/src/components/Agents/AgentChatInput.tsx
  • core-web/src/components/Agents/AgentChatMessage.tsx
  • core-web/src/components/Agents/AgentConfigPanel.tsx
  • core-web/src/components/Calendar/components/TimelineGrid.tsx
  • core-web/src/components/Calendar/components/WeekView.tsx
  • core-web/src/components/Chat/ChatMessage.tsx
  • core-web/src/components/Chat/ChatView.tsx
  • core-web/src/components/Chat/ContentPartsRenderer.tsx
  • core-web/src/components/Chat/StreamingText.tsx
  • core-web/src/components/Landing/LandingPage.tsx
  • core-web/src/components/MiniAppHeader/MiniAppHeader.tsx
  • core-web/src/components/Onboarding/OnboardingSidebarPreview.tsx
  • core-web/src/components/Onboarding/OnboardingWizard.tsx
  • core-web/src/components/Projects/components/KanbanColumn.tsx
  • core-web/src/components/Sidebar/Sidebar.tsx
  • core-web/src/components/SidebarChat/SidebarChatMessage.tsx
  • core-web/src/components/ai-app-builder/BuilderChat.tsx
  • core-web/src/components/ai-app-builder/BuilderPreview.tsx
  • core-web/src/index.css
✅ Files skipped from review due to trivial changes (18)
  • core-web/src/components/Agents/AgentChatInput.tsx
  • core-web/src/components/MiniAppHeader/MiniAppHeader.tsx
  • core-web/src/components/Agents/AgentChatMessage.tsx
  • core-web/src/components/Agents/AgentConfigPanel.tsx
  • core-web/src/components/Onboarding/OnboardingSidebarPreview.tsx
  • core-web/src/components/Chat/ChatView.tsx
  • core-web/src/components/Calendar/components/TimelineGrid.tsx
  • core-web/src/components/SidebarChat/SidebarChatMessage.tsx
  • core-web/src/components/Chat/ChatMessage.tsx
  • core-web/src/components/ai-app-builder/BuilderChat.tsx
  • core-web/src/components/ai-app-builder/BuilderPreview.tsx
  • core-web/src/components/Onboarding/OnboardingWizard.tsx
  • core-web/src/components/Calendar/components/WeekView.tsx
  • core-web/src/components/Projects/components/KanbanColumn.tsx
  • core-web/src/components/Chat/StreamingText.tsx
  • core-web/src/components/Sidebar/Sidebar.tsx
  • core-web/src/components/Chat/ContentPartsRenderer.tsx
  • core-web/src/components/Landing/LandingPage.tsx

📝 Walkthrough

Walkthrough

Replaced multiple hard-coded color values with CSS custom properties and Tailwind design-token classes across UI components, added new theme CSS variables, and made .gitignore Supabase rules use recursive glob patterns.

Changes

Cohort / File(s) Summary
Gitignore
\.gitignore
Changed Supabase ignore patterns from fixed paths (supabase/.temp/, supabase/.branches/) to recursive globs (**/supabase/.temp/, **/supabase/.branches/).
Theme tokens (CSS)
core-web/src/index.css
Added/expanded design token CSS variables: --color-text-icon, --color-bg-surface, --color-bg-panel, --color-bg-bubble, --color-bg-input, --color-bg-hover, --color-bg-sidebar, --color-bg-code, --color-bg-code-header.
Calendar styling
core-web/src/components/Calendar/components/AllDayEventsSection.tsx, core-web/src/components/Calendar/components/DraggableEventBlock.tsx, core-web/src/components/Calendar/components/MonthView.tsx, core-web/src/components/Calendar/components/TimelineGrid.tsx, core-web/src/components/Calendar/components/WeekView.tsx
Replaced hard-coded white/background hex values with var(--color-bg-white) or Tailwind theme classes (e.g., bg-bg-surface); outlined event backgrounds switched from #FFFFFF to var(--color-bg-white). Removed inline hard-coded background styles in timeline containers.
Chat components
core-web/src/components/Chat/ContentPartsRenderer.tsx, core-web/src/components/Chat/StreamingText.tsx, core-web/src/components/Chat/ChatMessage.tsx, core-web/src/components/Chat/ChatView.tsx
Swapped hard-coded background hexes for code blocks, inline code, and chat surfaces to token-based classes (bg-bg-code, bg-bg-surface, bg-bg-bubble, bg-border-light, var(--color-bg-code)) and updated related header backgrounds.
Dropdown
core-web/src/components/Dropdown/Dropdown.tsx
Updated inline container style to use CSS variables: backgroundColor from #FFFFFFvar(--color-bg-white) and border from 1px solid #E7E7E6`` → 1px solid var(--color-border-gray).
Landing & Onboarding previews
core-web/src/components/Landing/LandingPage.tsx, core-web/src/components/Onboarding/OnboardingSidebarPreview.tsx, core-web/src/components/Onboarding/OnboardingWizard.tsx
Replaced several hard-coded background and text color hexes with Tailwind token classes (bg-bg-sidebar, bg-bg-surface, bg-bg-panel, bg-bg-bubble, text-text-tertiary, border-border-gray).
Agent & Builder chat UI
core-web/src/components/Agents/AgentChatInput.tsx, core-web/src/components/Agents/AgentChatMessage.tsx, core-web/src/components/Agents/AgentConfigPanel.tsx, core-web/src/components/ai-app-builder/BuilderChat.tsx, core-web/src/components/ai-app-builder/BuilderPreview.tsx
Replaced hard-coded bubble/input/panel background colors with token classes like bg-bg-input, bg-bg-panel, bg-bg-bubble. Layout and logic unchanged.
Sidebar & Mini headers
core-web/src/components/Sidebar/Sidebar.tsx, core-web/src/components/SidebarChat/SidebarChatMessage.tsx, core-web/src/components/MiniAppHeader/MiniAppHeader.tsx
Replaced hard-coded icon/text and background colors with token classes (text-text-icon, bg-bg-sidebar, border-bg-sidebar, bg-bg-input).
Projects/Kanban
core-web/src/components/Projects/components/KanbanColumn.tsx
Swapped column background and drag-over background hex classes for theme tokens (bg-bg-panel, bg-bg-hover); ring and drag logic unchanged.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰
I nibbled hexes, hopped through style,
Swapped tokens in a single file,
Variables planted, themes take flight,
The UI hums in softer light.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Out of Scope Changes check ❓ Inconclusive All changes are directly related to the PR objective: replacing hardcoded colors with design tokens. The .gitignore update is a minor housekeeping change tangential to the main scope. Consider whether the .gitignore update (supabase path changes) belongs in this PR or should be split into a separate commit for clarity.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly summarizes the main objective of the PR: replacing hardcoded hex colors with Tailwind design tokens.
Linked Issues check ✅ Passed The PR successfully replaces hardcoded hex colors with Tailwind design tokens across 20+ component files, adds new theme tokens to index.css, and directly addresses all coding requirements from issue #11.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
core-web/src/components/Landing/LandingPage.tsx (1)

267-293: Consider replacing text-[#000] with text-text-body for consistency.

The file now mixes text-text-body (used elsewhere, e.g., lines 181, 196) with hardcoded text-[#000]. Since #000 is equivalent to #000000 which matches --color-text-body, these could be unified for consistency with the PR's goal of using design tokens.

Affected lines: 268, 272, 283, 291.

♻️ Suggested diff
                                 <div className="flex justify-end">
-                                  <div className="bg-[`#F4F4F4`] rounded-[10px] px-2.5 py-1.5 max-w-[70%]">
-                                    <p className="text-[9px] text-[`#000`]">What's on my schedule today?</p>
+                                  <div className="bg-[`#F4F4F4`] rounded-[10px] px-2.5 py-1.5 max-w-[70%]">
+                                    <p className="text-[9px] text-text-body">What's on my schedule today?</p>
                                   </div>
                                 </div>
                                 <div className="max-w-[85%]">
-                                  <p className="text-[9px] text-[`#000`] mb-1.5">You have 3 meetings today:</p>
+                                  <p className="text-[9px] text-text-body mb-1.5">You have 3 meetings today:</p>
                                   <div className="space-y-1">
                                     ...
                                           <p className="text-[7px] text-text-tertiary">{evt.time}</p>
-                                          <p className="text-[8px] font-medium text-[`#000`]">{evt.title}</p>
+                                          <p className="text-[8px] font-medium text-text-body">{evt.title}</p>
                                     ...
                                 </div>
                                 <div className="flex justify-end">
                                   <div className="bg-[`#F4F4F4`] rounded-[10px] px-2.5 py-1.5 max-w-[70%]">
-                                    <p className="text-[9px] text-[`#000`]">Draft a reply to Sarah's email</p>
+                                    <p className="text-[9px] text-text-body">Draft a reply to Sarah's email</p>
                                   </div>
                                 </div>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@core-web/src/components/Landing/LandingPage.tsx` around lines 267 - 293,
Replace hardcoded text color classes `text-[`#000`]` in LandingPage.tsx with the
design-token class `text-text-body` for consistency; update the <p> elements
inside the schedule card and the draft-reply card (the elements rendering
"What's on my schedule today?", "You have 3 meetings today:", each event title
line using {evt.title}, and "Draft a reply to Sarah's email") so their className
uses `text-text-body` instead of `text-[`#000`]`. Ensure you change every
occurrence in the mapped event block and the surrounding static <p> elements so
all text uses `text-text-body` consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.gitignore:
- Around line 45-47: This PR contains unrelated .gitignore changes (the
recursive patterns "**/supabase/.temp/" and "**/supabase/.branches/") that
should be moved out of the color-token refactor; revert or remove those two Git
ignore entries from this branch and create a small housekeeping branch/PR with
the .gitignore edits instead, then update this PR to include only the intended
color-token replacements and add the missing seven component files (Chat,
Calendar, Dropdown, Landing components) referenced in the summary so the diff
matches the PR description.

---

Nitpick comments:
In `@core-web/src/components/Landing/LandingPage.tsx`:
- Around line 267-293: Replace hardcoded text color classes `text-[`#000`]` in
LandingPage.tsx with the design-token class `text-text-body` for consistency;
update the <p> elements inside the schedule card and the draft-reply card (the
elements rendering "What's on my schedule today?", "You have 3 meetings today:",
each event title line using {evt.title}, and "Draft a reply to Sarah's email")
so their className uses `text-text-body` instead of `text-[`#000`]`. Ensure you
change every occurrence in the mapped event block and the surrounding static <p>
elements so all text uses `text-text-body` consistently.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f25b0b95-b672-470f-a78f-43728ca2a1c8

📥 Commits

Reviewing files that changed from the base of the PR and between f50fda1 and b8ab7c0.

📒 Files selected for processing (8)
  • .gitignore
  • core-web/src/components/Calendar/components/AllDayEventsSection.tsx
  • core-web/src/components/Calendar/components/DraggableEventBlock.tsx
  • core-web/src/components/Calendar/components/MonthView.tsx
  • core-web/src/components/Chat/ContentPartsRenderer.tsx
  • core-web/src/components/Chat/StreamingText.tsx
  • core-web/src/components/Dropdown/Dropdown.tsx
  • core-web/src/components/Landing/LandingPage.tsx

Comment thread .gitignore Outdated
Comment on lines +45 to +47
# Supabase local (match nested e.g. core-api/supabase/)
**/supabase/.temp/
**/supabase/.branches/

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

These changes are unrelated to the stated PR objectives.

The .gitignore updates for Supabase artifacts are technically correct (the recursive **/ patterns will properly match nested directories), but they are completely unrelated to the PR's stated goal of "Replace hardcoded hex colors with Tailwind design tokens."

Additionally, the PR summary mentions updating 7 component files across Chat, Calendar, Dropdown, and Landing, but only .gitignore is provided for review.

Recommendations:

  1. Move these .gitignore changes to a separate housekeeping PR.
  2. Ensure this PR only contains the color token replacements described in the objectives.
  3. Verify that all 7 mentioned component files are included in the PR.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.gitignore around lines 45 - 47, This PR contains unrelated .gitignore
changes (the recursive patterns "**/supabase/.temp/" and
"**/supabase/.branches/") that should be moved out of the color-token refactor;
revert or remove those two Git ignore entries from this branch and create a
small housekeeping branch/PR with the .gitignore edits instead, then update this
PR to include only the intended color-token replacements and add the missing
seven component files (Chat, Calendar, Dropdown, Landing components) referenced
in the summary so the diff matches the PR description.

@AakashKB
AakashKB force-pushed the fix/replace-hardcoded-colors-with-tokens branch from b8ab7c0 to ac4bf0a Compare April 1, 2026 18:19
@AakashKB

AakashKB commented Apr 1, 2026

Copy link
Copy Markdown
Contributor Author

Made a commit to add new themes where a match for hard-coded color was non-existent. Can revert this if we just want it for exact matches.

And it seems the existing tw themes diverge from the design guideline mdx tokens. Using index as source of truth for now, lmk if otherwise

@sonarqubecloud

sonarqubecloud Bot commented Apr 1, 2026

Copy link
Copy Markdown

hackertron
hackertron previously approved these changes Apr 3, 2026
@hackertron
hackertron dismissed their stale review April 3, 2026 10:11

need to review again

@hackertron

Copy link
Copy Markdown
Contributor

@benwxng

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace hardcoded hex colors with Tailwind design tokens

2 participants