Neden migration başarısız oldu? Kritik farklılıklar
// tailwind.config.js
module.exports = {
theme: {
extend: {
colors: {
'muzibu-coral': '#ff7f50',
'spotify-green': '#1DB954',
}
}
},
safelist: [
'bg-muzibu-coral',
'from-muzibu-coral',
'bg-black/70',
// 70+ classes...
]
}
/* app.css */
@import "tailwindcss";
@theme {
--color-muzibu-coral: #ff7f50;
--color-spotify-green: #1DB954;
}
/* ⚠️ SAFELIST YOK! */
⚠️ Kırılan Nokta: v4'te JS config kaldırıldı, safelist mekanizması yok!
// postcss.config.js
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
// postcss.config.js
export default {
plugins: {
'@tailwindcss/postcss': {},
autoprefixer: {},
},
};
📦 Package: v4'te @tailwindcss/postcss ve @tailwindcss/cli ayrı paketler!
/* app.css */
@tailwind base;
@tailwind components;
@tailwind utilities;
/* app.css */
@import "tailwindcss";
✅ Basitleşti: Tek satıra indi ama eski syntax kaldırıldı!
v3'te dinamik class'ları korumak için safelist array kullanıyorduk:
// v3 - tenant-1001.config.js
safelist: [
'bg-gradient-to-br',
'from-muzibu-coral', 'to-pink-600',
'bg-black/70', 'bg-white/10',
'bg-spotify-green', 'text-spotify-green',
'hover:bg-muzibu-coral',
'bg-gray-800/50',
// ... toplam 70+ class
]
safelist array tamamen kaldırıldıfrom-muzibu-coral to-pink-600 gradient'leribg-black/70, bg-white/10 opacity'lerbg-spotify-green, text-spotify-green renklerihover:bg-muzibu-coral state'leriv3 (Optimize)
v4 (İlk deneme)
Bloat oranı
colors: {
'muzibu-coral': '#ff7f50',
'spotify-green': '#1DB954',
}
// Compiled:
.bg-muzibu-coral {
background-color: #ff7f50;
}
@theme {
--color-muzibu-coral: #ff7f50;
}
// Compiled (BROKEN!):
:root {
--color-muzibu-coral: coral;
/* ❌ Keyword, hex değil! */
}
🐛 Bug: v4'te #ff7f50 → coral keyword'e dönüştü, gradient'ler bozuldu!
💡 Çözüm: rgb() format kullan: --color-muzibu-coral: rgb(255 127 80);
tailwind.config.js - Artık yok!safelist array - Tamamen kaldırıldı@tailwind directives - Deprecatedpurge / content - Farklı çalışıyorcheckpoint-0-pre-migration ✅ v3 stable (geri dönüldü)
checkpoint-1-packages ❌ v4.1.18 (bloat)
checkpoint-2-postcss ❌ @tailwindcss/postcss
checkpoint-3-css-import ❌ @import syntax
checkpoint-4-colors ❌ @theme (coral bug)
checkpoint-5-build ❌ 830 KB
checkpoint-6-homepage-broken ❌ Tasarım berbat
checkpoint-10-complete ❌ Migration failed
| Özellik | v3 (Stable) | v4 (Modern) |
|---|---|---|
| Config Format | tailwind.config.js | @theme (CSS) |
| Import Syntax | @tailwind directives | @import "tailwindcss" |
| PostCSS Plugin | tailwindcss | @tailwindcss/postcss |
| Safelist | ✅ Array (70+ class) | ❌ Yok |
| Color System | HEX/RGB | OKLCH |
| CSS Size (Muzibu) | 255 KB | 830 KB (+225%) |
| Build Engine | JavaScript (Node) | Rust (Oxide) |
| JIT Mode | Optional flag | Always on |
| Custom Plugins | ✅ Full API | ⚠️ Limited (new API) |
| Cascade Layers | Manual @layer | ✅ Native |
| Backward Compat | ✅ Stable | ❌ Breaking changes |
| Muzibu İçin Öneri | ✅ KAL | ❌ GEÇME |