creating a mixin for linear gradient in sass code example
Example: scss gradient mixin
@mixin gradient($start-color, $end-color, $orientation) {
background: $start-color;
@if $orientation == 'vertical' {
background: linear-gradient(to bottom, $start-color, $end-color);
} @else if $orientation == 'horizontal' {
background: linear-gradient(to right, $start-color, $end-color);
} @else {
background: radial-gradient(ellipse at center, $start-color, $end-color);
}
}
.gradient {
@include gradient(#07c, #06f, vertical);
}