Colors

Text color utilities map to semantic role tokens. Use them to apply role-based colour without writing custom CSS.

Text colors

Each class sets the color property to a role token. Use text-inverse on dark backgrounds for contrast.

index.htmlhtml
<p class="text-primary border rounded-sm p-2 mb-3">text-primary</p>
<p class="text-secondary border rounded-sm p-2 mb-3">text-secondary</p>
<p class="text-success border rounded-sm p-2 mb-3">text-success</p>
<p class="text-warning border rounded-sm p-2 mb-3">text-warning</p>
<p class="text-danger border rounded-sm p-2 mb-3">text-danger</p>
<p class="text-info border rounded-sm p-2 mb-3">text-info</p>
<p class="text-muted border rounded-sm p-2 mb-3">text-muted</p>
<p class="text-subtle border rounded-sm p-2 mb-3">text-subtle</p>
<p class="text-inverse bg-surface-inverse border rounded-sm p-2">text-inverse</p>

text-primary

text-secondary

text-success

text-warning

text-danger

text-info

text-muted

text-subtle

text-inverse

Reference

ClassPropertyResponsive
.text-primarycolor: var(--primary-text)No
.text-secondarycolor: var(--secondary-text)No
.text-successcolor: var(--success-text)No
.text-warningcolor: var(--warning-text)No
.text-dangercolor: var(--danger-text)No
.text-infocolor: var(--info-text)No
.text-mutedcolor: var(--c-muted)No
.text-subtlecolor: var(--c-subtle)No
.text-inversecolor: var(--c-inverse)No