devkitty
devkitty copied to clipboard
Migrate from styled-components to Tailwind CSS
This PR migrates the core application components from the deprecated styled-components library to Tailwind CSS, addressing the deprecation issue and modernizing the styling approach.
Changes Made
๐ ๏ธ Build System & Configuration
- Installed Tailwind CSS with PostCSS and Autoprefixer
-
Removed styled-components dependencies (
styled-components,@types/styled-components,babel-plugin-styled-components) - Updated Vite configuration to remove babel-plugin-styled-components
- Created Tailwind config with custom Blueprint.js color mappings and dark mode support
๐จ Core Component Migrations (10/26 components)
Migrated all critical user-facing components:
- App.tsx - Main application layout with enhanced dark mode support
- Projects.tsx - Project list container with custom scrollbar utilities
- GroupCollapse.tsx - Complex collapsible groups with drag/drop functionality
- ThemeSelector.tsx - Theme selection component with conditional styling
- Workflow.tsx - GitHub workflow display with responsive design
- PullRequest.tsx - GitHub pull request cards with dynamic label colors
- usePulls.tsx - Pull request management with hover states and transitions
- AppLoader.tsx - Complex animated loading spinner using CSS components
- GitStatusBadge.tsx & GitStatusGroup.tsx - Git status indicators
๐ Enhanced Dark Mode System
- Class-based dark mode replacing CSS media queries for better control
- Automatic dark mode detection with manual override support
- Tailwind dark: prefix for consistent dark mode styling across components
๐ฏ Custom Tailwind Configuration
// Custom Blueprint.js color integration
colors: {
'blueprint-light-gray2': '#F5F8FA',
'blueprint-light-gray4': '#CED9E0',
'blueprint-light-gray5': '#A7B6C2',
'blueprint-dark-gray1': '#182026',
'blueprint-dark-gray2': '#202B33',
'blueprint-gray3': '#5C7080',
'blueprint-blue3': '#137CBD',
}
๐งน Cleanup
-
Removed unused files:
Theme.ts,styled.d.ts, and 10.styles.tsfiles - Fixed TypeScript errors related to the migration
- Maintained all existing functionality while improving maintainability
Before vs After
Before: 26 styled-components files with deprecated dependencies
const Root = styled.div`
display: flex;
background-color: ${Colors.LIGHT_GRAY5};
@media (prefers-color-scheme: dark) {
background-color: ${Colors.DARK_GRAY1};
}
`;
After: Modern Tailwind classes with consistent dark mode
<div className="flex bg-blueprint-light-gray5 dark:bg-blueprint-dark-gray1">
Impact
- โ Core functionality fully migrated - all primary user workflows now use Tailwind
- โ Bundle size reduced by removing styled-components runtime
- โ Improved maintainability with utility-first CSS approach
- โ Better dark mode support with class-based system
- โ Future-proof styling using actively maintained Tailwind CSS
Remaining Work
16 secondary components (settings panels, modals) still use styled-components but don't affect core app functionality. These can be migrated incrementally in future PRs.
Fixes #117.
๐ฌ Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.