Trick of the day: Sass, Mixin or Placeholder?

Trick of the day: Sass, Mixin or Placeholder?

Without any doubt, two of the best and most useful features of Sass are mixins and placeholders. A mixin is a directive similar to a function in programming languages in that you can pass arguments. However, a mixin outputs CSS code instead of returning a value as the result of its execution. A placeholder is similar to an abstract class of an object oriented language. When your Sass code is compiled, the body of a placeholder isn’t included in the CSS code unless there’s a CSS class extending the placeholder.