Setting text color using the container's background-color:
// set text color based on bg
@function set-text-color($color) {
    @if (lightness($color) > 70) {
        @return #333;
    } @else {
        @return #fff;
    }
}

// set bg color & text color
@mixin set-background($color) {
    background-color: $color;
    color: set-text-color($color);
}
Use the mixin - "set-background"
h1 {
    @include set-background($primary-color);
}
Changing bg-color effect on text-color: https://youtu.be/nu5mdN2JIwM?t=2333
by Valeri Tandilashvili
4 years ago
Sass
functions
Sass Crash Course
0
Pro tip: use ```triple backticks around text``` to write in code fences