1. Reusable snippets.
Sass Mixins
@mixin my-custom-mixin {
border: 1px solid $color;
padding: $padding;
}
!
// Use your mixin over and over again
.element {
@include my-custom-mixin;
}
1
2. Useful Mixins
@mixin font-primary {
font-family: “Hip Web Font”, Arial, sans-serif;
font-weight: 400;
}
!
// Use the mixin over and over again
.element {
@include font-primary;
}
2
3. Useful Mixins + Variables
$color-primary: #FFCC00;
@mixin font-primary {
font-family: “Hip Web Font”, Arial, sans-serif;
font-weight: 400;
}
!
// Use the mixin over and over again
.element {
@include font-primary;
color: $color-primary;
}
3
5. I now can stop repeating myself. I now can stop repeating myself.
Compass Mixins
@include border-radius(...);
@include box-shadow(...);
@include text-shadow(...);
@include scale(...);
@include rotate(...);
@include transform2d(...);
@include transform3d(...);
5