Co-authored-by: Douwe Osinga <douwe@squareup.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
4.2 KiB
Safe CSS Cleanup Complete ✅
Summary
Successfully cleaned up CSS variables while maintaining Tailwind v4's double-prefix naming convention (bg-background-*, text-text-*, border-border-*).
Files Modified: 5 Variables Removed: 8 Issues Fixed: 8
Changes Made
1. Removed Unused Variables (8 removed)
From :root and .dark:
--background-app(0 uses) - redundant with--background-default--background-card(0 uses after consolidation)--background-strong(0 uses)--border-input(0 uses)--background-success(0 uses)--background-warning(0 uses)--border-success(0 uses)--border-warning(0 uses)
From @theme inline:
--color-background-strong--color-background-success--color-background-info--color-background-warning--color-background-card--color-border-input--color-border-success--color-border-warning
2. Added Missing Variable (1 added)
Added to :root and .dark:
--placeholder: var(--color-neutral-400)- for form input placeholders
3. Fixed Undefined Variables (4 fixes)
LocalModelManager.tsx:
bg-accent-primary→bg-background-accent(3 instances)border-accent-primary→border-border-accent(1 instance)
search.css:
var(--text-standard)→var(--text-default)(1 instance)var(--text-prominent)→var(--text-default)(1 instance)
4. Consolidated Duplicate Variables (3 fixes)
Deduped bg-background-card → bg-background-default:
- card.tsx - Card component base class
- ScheduleDetailView.tsx - Schedule detail card (2 instances)
Result: Both had identical values in light (#ffffff) and dark (#22252a) modes.
Files Changed
- ui/desktop/src/styles/main.css - Removed 8 unused variables, added --placeholder
- ui/desktop/src/styles/search.css - Fixed 2 old variable names
- ui/desktop/src/components/settings/dictation/LocalModelManager.tsx - Fixed 4 undefined variables
- ui/desktop/src/components/ui/card.tsx - Consolidated bg-background-card
- ui/desktop/src/components/schedule/ScheduleDetailView.tsx - Consolidated bg-background-card
What We Kept
✅ Tailwind v4 Double-Prefix Convention
Kept the naming pattern that Tailwind v4 expects:
bg-background-default(notbg-default)text-text-default(nottext-default)border-border-default(notborder-default)
This is how Tailwind v4's @theme inline works:
--color-background-*generatesbg-background-*utilities--color-text-*generatestext-text-*utilities--color-border-*generatesborder-border-*utilities
✅ All Semantically Meaningful Variables
Kept all variables that serve a purpose:
- State colors:
--background-danger,--background-info,--text-danger, etc. - Hierarchy:
--background-muted,--background-medium,--text-muted - Inverse/accent:
--background-inverse,--text-inverse,--background-accent - UI-specific:
--sidebar-*,--placeholder,--ring,--shadow-default
Current Variable Count
Before: 38 CSS variables After: 30 CSS variables
Breakdown:
- Background: 6 variables (was 11)
- Border: 4 variables (was 7)
- Text: 7 variables
- Placeholder: 1 variable (added)
- Sidebar: 8 variables
- Other: 4 variables (ring, shadow, fonts, ease)
Health Status
✅ Zero undefined variables ✅ Zero unused variables ✅ Zero duplicate variables ✅ Tailwind v4 naming convention preserved ✅ All fixes are safe and non-breaking
What's Next
This cleanup makes the codebase ready for MCP standard migration. When migrating to MCP, we'll need to:
-
Map Tailwind's double-prefix pattern to MCP's single-prefix standard:
Current → MCP Standard -------------------------------------- bg-background-default → bg-primary bg-background-muted → bg-secondary text-text-default → text-primary text-text-muted → text-secondary -
Either:
- Option A: Update all component classes to MCP names and change Tailwind theme config
- Option B: Create a mapping layer that translates MCP variables to Tailwind's expected format
The codebase is now clean and ready for either approach!