Index

Snap #01
Surcharge d'un mixin

Comment surcharger un @mixin via la directive @content ou des paramètres.

@mixin message-core() {
  background: #333;
  margin: 20px;
  @content;
}
@mixin message-padding($padding: 5px) {
  padding: $padding;
}
div.message{
  @include message-core() {
    margin: 5px;
  }
  @include message-padding($padding: 10px);
}

Compilé en :

div.message {
  background:#333;
  margin:20px;
  margin:5px;
  padding:10px;
}