Skip to content

Text color

Color utilities use semantic tokens that automatically adapt to light/dark themes and maintain proper contrast ratios.

ClassStyles
af-textcolor: var(--af-color-text)
af-text-mutedcolor: var(--af-color-text-muted)
af-text-inversecolor: var(--af-color-text-inverse)
af-text-primarycolor: var(--af-color-primary)
af-text-linkprimary color + underline
af-text-successcolor: var(--af-color-success)
af-text-dangercolor: var(--af-color-danger)
af-text-warningcolor: var(--af-color-warning)
af-text-infocolor: var(--af-color-info)
Common text colors

Default

Muted

Primary

Link

<div style="display:grid; gap: var(--af-space-2);">
  <p class="af-text">
    Default
  </p>
  <p class="af-text-muted">
    Muted
  </p>
  <p class="af-text-primary">
    Primary
  </p>
  <a class="af-text-link" href="#">
    Link
  </a>
</div>
  • af-text - Default text color
  • af-text-muted - Muted text color
  • af-text-inverse - Inverse text color
  • af-text-primary - Primary intent color
  • af-text-link - Link color
  • af-text-success - Success intent color
  • af-text-danger - Danger intent color
  • af-text-warning - Warning intent color
  • af-text-info - Info intent color

Mid-tone intent text utilities (af-text-success, af-text-warning, af-text-info) can fail WCAG AA on white or soft backgrounds at small sizes. For soft surfaces and badge-like labels, use --af-color-*-hard (see Tokens and Badge).

All text color utilities support responsive variants using the @{bp} suffix. See Responsive Suffix for syntax and breakpoints.