using a mixin code example
Example 1: sass mixin
@mixin transform($property) {
-webkit-transform: $property;
-ms-transform: $property;
transform: $property;
}
.box { @include transform(rotate(30deg)); }
Example 2: What is a Mixin?
@mixin my-flex {
display:flex;
align-items:center;
justify-content:center;
}
$font-color: red;
@mixin my-font($font-color) {...}
div {
@include my-flex;
}
Example 3: scss variables mixins
// styles.scss
@use 'base';
.inverse {
background-color: base.$primary-color;
color: white;
}