Hai loại biến trong CSS ecosystem với cách hoạt động khác nhau:
- Custom Properties: runtime, tham gia cascade/inherit, thay đổi bằng JS, scope theo DOM. Mạnh hơn cho theming và responsive.
- SASS variables: compile-time, flat scope, không thay đổi runtime. Tốt hơn cho calculations phức tạp.
Two types of variables in the CSS ecosystem with different behavior:
- Custom Properties: runtime, participate in cascade/inheritance, changeable via JS, scoped to the DOM. More powerful for theming and responsive design.
- SASS variables: compile-time, flat scope, cannot change at runtime. Better for complex compile-time calculations.