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.

Sometimes, it’s hard to choose if you have to use a mixin or a placeholder in your Sass code. This article gives some good advises to help in this decision:

http://www.sitepoint.com/sass-mixin-placeholder/

Trick of the day: Sass, Mixin or Placeholder?
Tagged on: