Sass mixing provides the facility to reuse the
CSS code.This functionality reduces the amount of code. You can write it once and reference it as per requirement.
Sass mixin can be created very easily by using the
@mixin followed by its name i.e
@mixin HeadingColor .
It can be referenced with @include followed by the name of the mixin.
So, to include the headingText mixin created above:
A mixin can also accept argument. Let us understand it.
After transpilation, the CSS code will be:
Let us define a default value for mixin.
After transpiling the above sass code,the output css will be:
Let us see the mixin vendor prefix features.
Let us include the above mixing code.
After transpiring the above sass code, the resultant CSS code will be.