background: adjust(#d32f2f lightness -10%); // ✅ Works (CSS Color Module Level 5 syntax)
Why Did This Change?
Old Sass (LibSass, Ruby Sass) used global functions like adjust-color(), lighten(), darken().
New Dart Sass (2.0.0+) uses modules (color.adjust(), list.append(), etc.) for better organization.
Future-proofing: The old functions will be removed in Dart Sass 3.0.0.
Additional Fixes for Common Cases
1. Adjusting Lightness
// Old (Deprecated)
background: darken(#4CAF50, 10%);
// New (Recommended)
background: color.adjust(#4CAF50, $lightness: -10%);
2. Adjusting Opacity
// Old (Deprecated)
background: transparentize(#1976d2, 0.2);
// New (Recommended)
background: color.adjust(#1976d2, $alpha: -0.2);
Final Notes
✅ Best Practice: Use color.adjust() for clarity and future compatibility.
❌ Avoid:adjust-color(), lighten(), darken() (deprecated).
⚠️ If Using adjust(): Stick to CSS-spec syntax (adjust(#color lightness -10%)).