Reference

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 ClassTailwind Equivalent
navbarbg-abbvie shadow-navbar
navbar-brandnavbar-brand (custom utility)
nav-linknav-link (custom utility)
containermax-w-7xl mx-auto px-4
rowgrid grid-cols-1 md:grid-cols-2
colGrid column classes
btn btn-primarypx-4 py-2 bg-blue-600 text-white rounded-md
dropdown-menudropdown-menu (custom utility)
text-endtext-right
mt-4mt-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

  1. Apply Tailwind classes to remaining React components
  2. Replace all Material Symbol icons with Phosphor
  3. Update existing CSS files to use Tailwind utilities

Phase 2: Remove Bootstrap Dependencies

  1. Remove Bootstrap CSS/JS from clientlibs
  2. Update any remaining Bootstrap markup
  3. Test thoroughly in AEM environment

Phase 3: Optimize Build Process

  1. Consider moving from CDN to npm package for production
  2. Set up Tailwind CSS purging for smaller bundles
  3. 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:

  1. Revert head.html to use Bootstrap CDN
  2. Restore original body.html
  3. Remove Alpine.js and Phosphor icons
  4. Use git to restore component files