Skip to content

Contrast Intent

The .contrast class provides a high-contrast visual style for links, buttons, and accordion elements. Use it to draw attention or indicate primary actions in high-visibility contexts.

Apply .contrast to <a> elements or elements with [role="link"] to emphasize them.

live preview
editable html
<a href="#" class="contrast">Regular Link</a>

<hr>

<a href="#" aria-current="page" class="contrast">Active link</a>
<hr>
<button class="contrast" role="link">
  &lt;button&gt; as link
</button>

<hr>

<button role="link" aria-current="page" class="contrast">Active button</button>

<hr>

<div class="contrast" role="link">
  &lt;div&gt; as link
</div>

<hr>

<div role="link" aria-current="page" class="contrast">Active div</div>

Buttons

Apply .contrast to <button> elements or elements with [role="button"] for a contrast action button.

live preview
editable html
<div class="auto-grid">
  <button class="contrast">
    Button
  </button>
  
  <div class="contrast" role="button">
    &lt;div&gt; as button
  </div>
  
  <details>
    <summary class="contrast" role="button" aria-haspopup="menu">
      Dropdown as a button
    </summary>
    <ul role="menu">
      <li><a role="menuitem" href="#">Solid</a></li>
      <li><a role="menuitem" href="#">Liquid</a></li>
      <li><a role="menuitem" href="#">Gas</a></li>
      <li><a role="menuitem" href="#">Plasma</a></li>
    </ul>
  </details>
</div>

Cards

Apply .contrast to an element with .card for a contrast action card.

live preview
See code

Modifiers

.contrast can be modified with .subtle to create cards with a more muted appearance, often used for less prominent actions.

live preview
See code

.contrast can be modified with .ghost to create ghost buttons and cards, which have a transparent background and a border, making them less visually prominent while still maintaining the contrast effect.

live preview
See code