component :: Testimonial

The .testimonial component is a quote with attribution: a figure wrapping mCSS’s already-styled blockquote, plus an Avatar byline. Pure HTML and CSS.

We deleted four hundred lines of utility classes the week we switched. The cascade does the work now.

FileDescriptionSource
component.testimonial.cssLayout + byline stylesGithub
elements.text.cssThe blockquote styling (dependency)Github
Testimonial.astro, Avatar.astroThe Astro componentsGithub
--testimonial-role-color in default themeTheme tokenGithub

HTML

<figure class="testimonial">
<blockquote class="testimonial_quote">
<p>We deleted four hundred lines of utility classes the week we switched.</p>
</blockquote>
<figcaption class="testimonial_byline">
<!-- avatar markup, see the Avatar docs -->
<div>
<span class="testimonial_name">Sonny Mueller</span>
<span class="testimonial_role">Design lead, Acme</span>
</div>
</figcaption>
</figure>

Custom properties

PropertyDescription
--testimonial-role-colorRole text color.

The quote itself is themed by the blockquote element styles.

Astro component

PropTypeDefaultDescription
namestringWho said it. Required (also feeds the Avatar initials when there is no photo).
rolestringundefinedTitle/company line.
avatarSrcImageMetadata | stringundefinedPhoto for the Avatar.
classstringundefinedAdditional CSS classes.

The default slot is the quote.

Examples