When using the @include
function, remember to use @mixin
.
An example of @MIXIN
:
@mixin customStyle($value) {
-webkit-customStyle: $value;
-moz-customStyle: $value;
-ms-customStyle: $value;
customStyle: $value;
}
Your code can be something like this:
@mixin applyEffect($val) {
-webkit-transform: $val;
-moz-transform: $val;
-ms-transform: $val;
transform: $val;
}
main {
.box {
@include applyEffect(rotate(45deg) translate3d(0,0,0));
}
}
The output will look like this:
main .box {
-webkit-transform: rotate(45deg) translate3d(0,0,0);
-moz-transform: rotate(45deg) translate3d(0,0,0);
-ms-transform: rotate(45deg) translate3d(0,0,0);
transform: rotate(45deg) translate3d(0,0,0);
}
To learn more about it, visit this link