Performance: @return statement
LOW IMPACT
The @return statement affects the performance of Sass compilation but does not impact browser rendering or page load speed directly.
@function calculate-padding($base) { @return $base * 1.5; } $padding: calculate-padding(10px); .element { padding: $padding; margin: $padding; border-width: $padding; }
@function calculate-padding($base) { @return $base * 1.5; } .element { padding: calculate-padding(10px); padding: calculate-padding(10px); padding: calculate-padding(10px); }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Using @return in Sass functions efficiently | 0 (compile-time only) | 0 | 0 | [OK] Good |
| Repeated calls to @return functions with same args | 0 (compile-time only) | 0 | 0 | [!] Warning |