Testimonials

The testimonials component is very similar to our image banner component. That means we can use the exact same function to ensure our text color is always the absolute contrast of the overlay color.

Open the scss/component/_testimonials.scss file and add the following:

.testimonial { 
    max-width: 20em; 
    margin: 0 auto; 
 
    @include media-centered($img: rounded, $color: abs-contrast-color(
    get($testimonials, overlay-color)));

    blockquote, cite {

        color: abs-contrast-color(get($testimonials, overlay-color));

    } 
 
    &s { 
        ... 
    } 
} 

As you can probably guess, the text will all be white now seeing as the overlay is dark:

Testimonials

Get Mastering Sass now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.