Sass Mixins
Sass Mixins
The @mixin directive lets you create CSS code that is to be reused throughout the website.
The @include directive is created to let you use (include) the mixin.
Sass scss
@mixin important-text { color: red; font-size: 25px; font-weight: bold; border: 1px solid blue; } .danger { @include important-text; background-color: green; }
CSS output
.danger { color: red; font-size: 25px; font-weight: bold; border: 1px solid blue; background-color: green; }