Skip to content

feat: integrate carrot-ui design tokens with Tailwind CSS v4 migration#57

Merged
santoshyadavdev merged 11 commits into
mainfrom
santoshyadavdev-add-carrot-ui-design-tokens
Jul 22, 2026
Merged

feat: integrate carrot-ui design tokens with Tailwind CSS v4 migration#57
santoshyadavdev merged 11 commits into
mainfrom
santoshyadavdev-add-carrot-ui-design-tokens

Conversation

@santoshyadavdev

@santoshyadavdev santoshyadavdev commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Migrated from Tailwind CSS v3 to v4 — replaced tailwind.config.js with CSS-first @theme blocks, added @tailwindcss/vite plugin
  • Integrated @coderabbitai/carrot-ui design tokens — imported scales.css (12-step OKLCH color scales) and theme.css (semantic tokens) for consistent theming
  • Switched dark mode from class-based to data-theme attributeThemeService now sets data-theme="dark|light" on <html>, matching carrot-ui's token switching mechanism
  • Replaced all ad-hoc color classes across header, share-dropdown, and dashboard components with semantic cui-* tokens (e.g., bg-cui-base-1, text-cui-primary, border-cui-neutral)
  • Updated share handler backgrounds to read computed CSS variable --background-color-cui-base-1 instead of hardcoded hex values
  • Installed Geist font (@fontsource-variable/geist) for typography

Design decisions

  • Milestone-type accent colors preserved — category-specific colors (violet, amber, teal, emerald) remain as Tailwind built-in palette; only gray defaults and coderabbit-orange references were migrated to cui-* tokens
  • hack-font CSS import removed — caused woff resolution errors in the Angular/Vite bundler; font can be added back via a different import strategy if needed

Test Plan

  • npx nx build yourstory — builds successfully
  • Pre-existing test failure (window.matchMedia mock missing in jsdom) confirmed on main — not introduced by this PR
  • Manual visual verification of light/dark mode toggle
  • Verify share-to-image captures correct background colors

Summary by CodeRabbit

  • New Features
    • Added a “Copy Share Link” action alongside sharing and image download.
  • Enhancements
    • Updated the app’s look and theming to use Carrot UI semantic design tokens (including header, dashboard, and share dropdown).
    • Improved light/dark theming behavior by driving it from the active theme selection.
    • Updated share/download image background rendering to follow the active token styling.
    • Upgraded styling foundation to Tailwind CSS v4.
  • Documentation
    • Added design-tokens integration plan and specification for the migration.
  • Chores
    • Updated font and Tailwind/PostCSS tooling to support the migration.

santoshyadavdev and others added 9 commits July 22, 2026 16:39
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use package export paths (@coderabbitai/carrot-ui/scales, /theme)
instead of direct src/ paths. Remove hack-font CSS import that
caused woff resolution errors in the bundler.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The Angular app migrates from Tailwind CSS v3 to v4 and adopts carrot-ui semantic tokens. Theme state now uses a root data-theme attribute, global styles use CSS-first imports, and header, sharing, dashboard, timeline, and insights surfaces are re-themed.

Changes

Carrot UI migration

Layer / File(s) Summary
Styling foundation and migration specification
docs/superpowers/..., package.json, yourstory/.postcssrc.json, yourstory/src/styles.css
Tailwind v4, carrot-ui, font packages, PostCSS configuration, token imports, animations, scrollbar styles, and migration documentation are introduced.
Data-attribute theme switching
yourstory/src/index.html, yourstory/src/app/core/services/theme.service.ts
The root document initializes data-theme="light", and theme application updates that attribute instead of the dark class.
Shared interface token styling
yourstory/src/app/layout/header.component.ts, yourstory/src/app/shared/components/share-dropdown/share-dropdown.component.ts
Header and share-dropdown styling replaces legacy palette classes with cui-* tokens while retaining existing interactions.
Dashboard styling and image backgrounds
yourstory/src/app/pages/dashboard/dashboard.component.ts
Story, timeline, insights, milestone, empty-state, sharing, and download surfaces are re-themed; image backgrounds read --background-color-cui-base-1.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested labels: enhancement

Poem

I’m a carrot-colored bunny, hopping through the theme,
Tailwind blooms in token rows, sharper than a dream.
Dark mode wears data-theme, light mode joins the play,
Share links, stories, and timelines shine brighter every day.
Boing! carrot-ui leads the way.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adopting carrot-ui tokens while migrating the app to Tailwind CSS v4.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch santoshyadavdev-add-carrot-ui-design-tokens

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Biome (2.5.3)
yourstory/src/styles.css

File contains syntax errors that prevent linting: Line 6: Tailwind-specific syntax is disabled.; Line 8: Tailwind-specific syntax is disabled.; Line 10: Tailwind-specific syntax is disabled.; Line 43: Tailwind-specific syntax is disabled.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


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

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 22, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
commitstory a7e1791 Commit Preview URL

Branch Preview URL
Jul 22 2026, 04:07 PM

@coderabbitai coderabbitai Bot added the enhancement New feature or request label Jul 22, 2026

@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: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/superpowers/plans/2026-07-22-carrot-ui-design-tokens.md`:
- Around line 42-45: Update the npm install command in the plan to run from the
repository root without the hardcoded machine-specific worktree path; remove the
absolute cd command and retain the dependency installation command.

In `@docs/superpowers/specs/2026-07-22-carrot-ui-design-tokens-design.md`:
- Around line 32-39: Update the architecture tree fence at
docs/superpowers/specs/2026-07-22-carrot-ui-design-tokens-design.md lines 32-39
to use the text language tag. In
docs/superpowers/plans/2026-07-22-carrot-ui-design-tokens.md lines 464-466, add
appropriate language tags and blank lines to the fence, and apply the same
formatting to all repeated replacement-table fences.
- Around line 105-109: Update the Testing section in
docs/superpowers/specs/2026-07-22-carrot-ui-design-tokens-design.md (lines
105-109) to document the known window.matchMedia jsdom failure and pending
manual checks. Update
docs/superpowers/plans/2026-07-22-carrot-ui-design-tokens.md (lines 267-273) to
replace the unconditional “all tests pass” expectation with the known baseline
and targeted validation requirements.
- Around line 24-26: Synchronize the migration documentation with the shipped
carrot-ui implementation: in
docs/superpowers/specs/2026-07-22-carrot-ui-design-tokens-design.md lines 24-26,
document package-root exports instead of /src CSS imports; at lines 74-78,
remove the Hack CSS instruction and describe the actual mono-font behavior; at
lines 93-99, state that carrot-ui is a devDependency. In
docs/superpowers/plans/2026-07-22-carrot-ui-design-tokens.md lines 15-20, use
the final dependency classification, and at lines 105-112 remove obsolete Hack
and /src/*.css imports.

In `@yourstory/src/app/pages/dashboard/dashboard.component.ts`:
- Line 140: Replace the text-gray-400 profile separator styling with
text-cui-tertiary in all three occurrences:
yourstory/src/app/pages/dashboard/dashboard.component.ts lines 140, 362, and
702.

In `@yourstory/src/styles.css`:
- Around line 10-15: Rename the camelCase animation identifiers referenced by
the --animate-fade-in, --animate-fade-in-slow, --animate-fade-in-slower, and
--animate-glow-pulse custom properties to lint-compliant kebab-case names, and
update their corresponding keyframe declarations consistently. Preserve the
existing animation timings and behavior.
🪄 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: ASSERTIVE

Plan: Pro

Run ID: 39d2fc76-db80-4c44-bba0-253a3eccfc46

📥 Commits

Reviewing files that changed from the base of the PR and between 9bccc5a and 31ebf13.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (11)
  • docs/superpowers/plans/2026-07-22-carrot-ui-design-tokens.md
  • docs/superpowers/specs/2026-07-22-carrot-ui-design-tokens-design.md
  • package.json
  • yourstory/src/app/core/services/theme.service.ts
  • yourstory/src/app/layout/header.component.ts
  • yourstory/src/app/pages/dashboard/dashboard.component.ts
  • yourstory/src/app/shared/components/share-dropdown/share-dropdown.component.ts
  • yourstory/src/index.html
  • yourstory/src/styles.css
  • yourstory/tailwind.config.js
  • yourstory/vite.config.mts
💤 Files with no reviewable changes (1)
  • yourstory/tailwind.config.js

Comment thread docs/superpowers/plans/2026-07-22-carrot-ui-design-tokens.md
Comment thread docs/superpowers/specs/2026-07-22-carrot-ui-design-tokens-design.md Outdated
Comment thread docs/superpowers/specs/2026-07-22-carrot-ui-design-tokens-design.md Outdated
Comment thread docs/superpowers/specs/2026-07-22-carrot-ui-design-tokens-design.md Outdated
Comment thread yourstory/src/app/pages/dashboard/dashboard.component.ts Outdated
Comment thread yourstory/src/styles.css Outdated
santoshyadavdev and others added 2 commits July 22, 2026 17:48
Angular's @angular/build:application executor uses esbuild, not Vite,
for production builds. The @tailwindcss/vite plugin only works in the
Vite dev server context, so Tailwind utilities were never generated
in the build output.

Switch to @tailwindcss/postcss with a .postcssrc.json config, which
Angular's PostCSS pipeline picks up correctly. Add @source directive
to ensure inline Angular templates in .ts files are scanned.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@santoshyadavdev

Copy link
Copy Markdown
Owner Author

Fixes Applied Successfully

Fixed 4 file(s) based on 6 unresolved review comment(s).

Files modified:

  • yourstory/src/styles.css — kebab-case keyframe names (stylelint compliance)
  • yourstory/src/app/pages/dashboard/dashboard.component.ts — replaced 3× text-gray-400text-cui-tertiary
  • docs/superpowers/specs/2026-07-22-carrot-ui-design-tokens-design.md — synced with shipped implementation (imports, fonts, test status, build config)
  • docs/superpowers/plans/2026-07-22-carrot-ui-design-tokens.md — removed machine-specific path, fixed dependency table, added fence language tags, corrected test expectations

Commit: a7e1791

The latest autofix changes are on the santoshyadavdev-add-carrot-ui-design-tokens branch.

@santoshyadavdev
santoshyadavdev merged commit 3c735b2 into main Jul 22, 2026
2 of 3 checks passed

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
yourstory/src/app/pages/dashboard/dashboard.component.ts (1)

29-29: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use contrasting foreground tokens wherever cui-inverse is the background.

Both sites apply the same token to the foreground and background, making the content unreadable.

  • yourstory/src/app/pages/dashboard/dashboard.component.ts#L29-L29: use an appropriate contrasting text token for the share toast.
  • yourstory/src/app/pages/dashboard/dashboard.component.ts#L518-L520: use an appropriate contrasting text token for the year badge.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@yourstory/src/app/pages/dashboard/dashboard.component.ts` at line 29, Replace
the foreground text token that duplicates cui-inverse in the share toast at
yourstory/src/app/pages/dashboard/dashboard.component.ts:29 with an appropriate
contrasting token. Apply the same correction to the year badge at
yourstory/src/app/pages/dashboard/dashboard.component.ts:518-520, ensuring both
elements remain readable against the cui-inverse background.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/superpowers/plans/2026-07-22-carrot-ui-design-tokens.md`:
- Around line 18-19: Align the Tailwind setup instructions throughout the plan
with the PostCSS approach: use `@tailwindcss/postcss` in the install command,
configure it in the PostCSS configuration, remove `@tailwindcss/vite` from the
Vite configuration, and replace wording that identifies Tailwind as a Vite
plugin with PostCSS-based terminology.

---

Outside diff comments:
In `@yourstory/src/app/pages/dashboard/dashboard.component.ts`:
- Line 29: Replace the foreground text token that duplicates cui-inverse in the
share toast at yourstory/src/app/pages/dashboard/dashboard.component.ts:29 with
an appropriate contrasting token. Apply the same correction to the year badge at
yourstory/src/app/pages/dashboard/dashboard.component.ts:518-520, ensuring both
elements remain readable against the cui-inverse background.
🪄 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: ASSERTIVE

Plan: Pro

Run ID: f8a656b8-85e8-4030-97ad-b6a7bb03af62

📥 Commits

Reviewing files that changed from the base of the PR and between f2020b8 and a7e1791.

📒 Files selected for processing (4)
  • docs/superpowers/plans/2026-07-22-carrot-ui-design-tokens.md
  • docs/superpowers/specs/2026-07-22-carrot-ui-design-tokens-design.md
  • yourstory/src/app/pages/dashboard/dashboard.component.ts
  • yourstory/src/styles.css

Comment on lines +18 to +19
| `yourstory/tailwind.config.js` | Delete | No longer needed with TW v4 CSS-first config |
| `yourstory/vite.config.mts` | Modify | Remove `@tailwindcss/vite` (PostCSS handles Tailwind) |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
rg -n '"`@tailwindcss/`(postcss|vite)"' package.json
rg -n 'tailwindcss|postcss' yourstory/.postcssrc.json yourstory/vite.config.mts

Repository: santoshyadavdev/commitstory

Length of output: 265


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- docs/superpowers/plans/2026-07-22-carrot-ui-design-tokens.md (lines 1-120) ---'
cat -n docs/superpowers/plans/2026-07-22-carrot-ui-design-tokens.md | sed -n '1,120p'

echo
echo '--- yourstory/vite.config.mts ---'
cat -n yourstory/vite.config.mts

echo
echo '--- yourstory/.postcssrc.json ---'
cat -n yourstory/.postcssrc.json

Repository: santoshyadavdev/commitstory

Length of output: 7975


Align the Tailwind setup with the PostCSS path. Step 1 says to add @tailwindcss/postcss, but the prose still describes it as the Vite plugin, and Step 2 still instructs adding @tailwindcss/vite. Update the install command, Vite/PostCSS config, and wording so they all match the same approach.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/superpowers/plans/2026-07-22-carrot-ui-design-tokens.md` around lines 18
- 19, Align the Tailwind setup instructions throughout the plan with the PostCSS
approach: use `@tailwindcss/postcss` in the install command, configure it in the
PostCSS configuration, remove `@tailwindcss/vite` from the Vite configuration, and
replace wording that identifies Tailwind as a Vite plugin with PostCSS-based
terminology.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant