Reference Bootstrap to Tailwind CSS v4 Conversion Summary
Bootstrap to Tailwind CSS v4 Conversion Summary
OtherEvergreenPublic
Key Changes Made
1. Head Template Updates
- ✅ Updated Tailwind CSS v4 CDN - Now using the latest stable version
- ✅ Enhanced Theme Configuration - Added comprehensive design tokens
- ✅ Added Phosphor Icons - Replacing Material Symbols
- ✅ Custom Utility Classes - Created AEM-specific utilities
2. Body Template Updates
- ✅ Navbar Conversion - Bootstrap navbar → Tailwind responsive navigation
- ✅ Grid System - Bootstrap rows/cols → Tailwind Grid/Flexbox
- ✅ Responsive Design - Mobile-first approach with Alpine.js
- ✅ Typography - Consistent text sizing and spacing
- ✅ Color System - Brand colors using CSS custom properties
3. React Component Updates
- ✅ Icon Replacement - Material Symbols → Phosphor Icons
- ✅ Button Styling - Bootstrap classes → Tailwind utilities
- ✅ Layout Updates - Modern grid and flexbox layouts
- ✅ Interactive States - Hover, focus, and active states
Bootstrap → Tailwind Class Mapping
| Bootstrap Class | Tailwind Equivalent |
|---|---|
navbar | bg-abbvie shadow-navbar |
navbar-brand | navbar-brand (custom utility) |
nav-link | nav-link (custom utility) |
container | max-w-7xl mx-auto px-4 |
row | grid grid-cols-1 md:grid-cols-2 |
col | Grid column classes |
btn btn-primary | px-4 py-2 bg-blue-600 text-white rounded-md |
dropdown-menu | dropdown-menu (custom utility) |
text-end | text-right |
mt-4 | mt-4 (same) |
Additional Dependencies Added
# For React components
npm install @phosphor-icons/react
# Alpine.js is loaded via CDN for dropdown functionality
Files That Need Updates
1. Package.json
{
"dependencies": {
"@phosphor-icons/react": "^2.0.15"
}
}
2. React Components to Update
- ✅
Playground.jsx(example provided) - 🔄
ComponentsDashboard.jsx - 🔄
TemplatesDashboard.jsx - 🔄
PolicyAccordion.jsx
3. CSS Files to Review
- 🔄
Playground.css - 🔄
AEMComponentsDashboard.css - 🔄
AEMTemplatesDashboard.css - 🔄
PolicyAccordion.css
Breaking Changes to Consider
1. JavaScript Dependencies
- Added: Alpine.js for dropdown functionality
- Removed: Bootstrap JavaScript (if you were using it)
2. CSS Utilities
- Some Bootstrap utilities may not have direct Tailwind equivalents
- Custom utilities created for AEM-specific patterns
3. Icon System
- Material Symbols → Phosphor Icons
- Different icon names and syntax
- Need to update all icon references
Testing Checklist
- Navigation works on mobile and desktop
- Dropdowns function correctly
- Icons display properly
- Forms maintain functionality
- Responsive design works across breakpoints
- AEM authoring experience unchanged
- Build process generates correct clientlibs
Performance Considerations
Improvements
- ✅ Smaller CSS bundle (Tailwind JIT)
- ✅ Tree-shakeable Phosphor icons
- ✅ Faster development with utility-first approach
Watch For
- 🔍 Alpine.js bundle size (~15KB)
- 🔍 Phosphor icons bundle size (tree-shaken)
- 🔍 Tailwind CSS compilation time
Next Steps
Phase 1: Update Remaining Components
- Apply Tailwind classes to remaining React components
- Replace all Material Symbol icons with Phosphor
- Update existing CSS files to use Tailwind utilities
Phase 2: Remove Bootstrap Dependencies
- Remove Bootstrap CSS/JS from clientlibs
- Update any remaining Bootstrap markup
- Test thoroughly in AEM environment
Phase 3: Optimize Build Process
- Consider moving from CDN to npm package for production
- Set up Tailwind CSS purging for smaller bundles
- Optimize icon loading strategy
AEM-Specific Considerations
- ✅ Clientlib generation unchanged
- ✅ Component dialogs still work
- ✅ Authoring experience preserved
- ✅ Custom utilities for AEM patterns
- 🔄 Test in AEM author and publish modes
Rollback Plan
If issues arise:
- Revert head.html to use Bootstrap CDN
- Restore original body.html
- Remove Alpine.js and Phosphor icons
- Use git to restore component files