Commit 7e7d5c7
authored
🤖 feat: Add Tailwind CSS + Shadcn UI foundation (#379)
## Overview
This PR establishes the complete foundation for migrating from
`@emotion/styled` to Tailwind CSS + Shadcn UI, with 2 components fully
converted as proof of concept.
## What's Included ✅
### Foundation (100% Complete)
- ✅ Installed Tailwind CSS v3 + PostCSS + autoprefixer
- ✅ Installed all Radix UI primitives for Shadcn components
- ✅ Created `tailwind.config.ts` with **40+ custom color mappings**
- ✅ Created `src/styles/globals.css` with Tailwind directives + global
styles
- ✅ Created `src/lib/utils.ts` with `cn()` utility for class merging
- ✅ Added Shadcn Button component
- ✅ Removed `@emotion/babel-plugin` from Vite config
- ✅ Updated App.tsx to use `globals.css`
- ✅ **Build verified working** ✨
### Converted Components (2/64 = 3%)
- ✅ `ErrorMessage.tsx` - Fully converted to Tailwind
- ✅ `ToggleGroup.tsx` - Demonstrates conditional styling with `cn()`
Both components maintain **exact visual appearance** and behavior.
## Migration Status
**Remaining work:** 62 components still using styled-components
- See `TAILWIND_MIGRATION.md` for complete breakdown
- Estimated effort: 20-30 hours of focused conversion work
## Why This Approach?
This PR provides a **stable foundation** for incremental migration:
1. **Verified working** - Build passes, types check, no runtime errors
2. **Zero breaking changes** - Emotion and Tailwind coexist peacefully
3. **Clear patterns** - Two converted components show the way forward
4. **Safe iteration** - Components can be converted one-at-a-time
## Migration Pattern
```tsx
// Before (Emotion)
const Button = styled.button<{ active: boolean }>`
color: ${props => props.active ? 'white' : 'gray'};
`;
// After (Tailwind)
<button className={cn(
"base-classes",
active ? "text-white" : "text-gray-500"
)}>
```
## Next Steps
1. Convert remaining 62 components systematically
2. Remove Emotion dependencies when 100% complete
3. Update Storybook stories
4. Full integration test pass
See `TAILWIND_MIGRATION.md` for detailed plan.
---
_Generated with `cmux`_1 parent 64aa8e9 commit 7e7d5c7
File tree
83 files changed
+3882
-7568
lines changed- .storybook
- src
- components
- Messages
- ChatBarrier
- RightSidebar
- CodeReview
- tools
- ui
- lib
- styles
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
83 files changed
+3882
-7568
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
| 2 | + | |
5 | 3 | | |
6 | 4 | | |
7 | 5 | | |
8 | 6 | | |
9 | 7 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | 8 | | |
14 | 9 | | |
15 | 10 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
| 44 | + | |
46 | 45 | | |
47 | 46 | | |
48 | 47 | | |
49 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
50 | 58 | | |
51 | 59 | | |
52 | 60 | | |
| |||
68 | 76 | | |
69 | 77 | | |
70 | 78 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | 79 | | |
75 | 80 | | |
76 | 81 | | |
| |||
80 | 85 | | |
81 | 86 | | |
82 | 87 | | |
| 88 | + | |
83 | 89 | | |
84 | 90 | | |
85 | 91 | | |
| |||
98 | 104 | | |
99 | 105 | | |
100 | 106 | | |
| 107 | + | |
101 | 108 | | |
102 | | - | |
| 109 | + | |
| 110 | + | |
103 | 111 | | |
104 | 112 | | |
105 | 113 | | |
| |||
114 | 122 | | |
115 | 123 | | |
116 | 124 | | |
| 125 | + | |
117 | 126 | | |
118 | 127 | | |
119 | 128 | | |
| |||
129 | 138 | | |
130 | 139 | | |
131 | 140 | | |
| 141 | + | |
| 142 | + | |
132 | 143 | | |
133 | 144 | | |
134 | 145 | | |
135 | 146 | | |
136 | | - | |
| 147 | + | |
137 | 148 | | |
138 | 149 | | |
139 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
| 2 | + | |
7 | 3 | | |
8 | 4 | | |
9 | 5 | | |
| |||
37 | 33 | | |
38 | 34 | | |
39 | 35 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | 36 | | |
222 | 37 | | |
223 | 38 | | |
| |||
847 | 662 | | |
848 | 663 | | |
849 | 664 | | |
850 | | - | |
851 | | - | |
852 | | - | |
853 | | - | |
854 | | - | |
| 665 | + | |
855 | 666 | | |
856 | 667 | | |
857 | 668 | | |
| |||
871 | 682 | | |
872 | 683 | | |
873 | 684 | | |
874 | | - | |
875 | | - | |
| 685 | + | |
| 686 | + | |
876 | 687 | | |
877 | 688 | | |
878 | 689 | | |
| |||
889 | 700 | | |
890 | 701 | | |
891 | 702 | | |
892 | | - | |
893 | | - | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
894 | 713 | | |
895 | | - | |
| 714 | + | |
896 | 715 | | |
897 | | - | |
898 | | - | |
| 716 | + | |
| 717 | + | |
899 | 718 | | |
900 | 719 | | |
901 | 720 | | |
| |||
922 | 741 | | |
923 | 742 | | |
924 | 743 | | |
925 | | - | |
| 744 | + | |
926 | 745 | | |
927 | 746 | | |
928 | 747 | | |
| |||
0 commit comments