Colors
Convey meaning through color with a handful of color utility classes.
On this page
Colors
Colorize text with color utilities. To colorize icons, please refer to our icon color section.
OUDS Web provides many .text-* and .bg-* utilities, but they should be used with care to meet our design specifications and WCAG 2.2 accessibility standards for color contrast.
To be sure to respect the specifications, it is necessary to define color, background-color and font-size altogether.
Thus, the .text-brand-primary color on light background (#f15e00) should only be used in a font size greater than 24px (using for example .fs-ds utility), or 19px bold (using for example .fs-hm and .fw-bold utilities).
The .text-brand-primary color on dark background (#ff7900) can be used in any size.
Here are some compliant combinations examples for texts:
Text brand-primary
Text default
Text disabled
Text inverse
Text muted
Text on-brand-primary
Text on-status-accent-emphasized
Text on-status-accent-muted
Text on-status-info-emphasized
Text on-status-info-muted
Text on-status-negative-emphasized
Text on-status-negative-muted
Text on-status-positive-emphasized
Text on-status-positive-muted
Text on-status-warning-emphasized
Text on-status-warning-muted
Text status-accent
Text status-info
Text status-negative
Text status-positive
Text status-warning
Text always-black
Text always-white
Text always-on-black
Text always-on-white
<p class="text-brand-primary p-small">Text brand-primary</p>
<p class="text-default p-small">Text default</p>
<p class="text-disabled p-small">Text disabled</p>
<p class="text-inverse p-small">Text inverse</p>
<p class="text-muted p-small">Text muted</p>
<p class="bg-brand-primary text-on-brand-primary p-small">Text on-brand-primary</p>
<p class="bg-status-accent-emphasized text-on-status-accent-emphasized p-small">Text on-status-accent-emphasized</p>
<p class="bg-status-accent-muted text-on-status-accent-muted p-small">Text on-status-accent-muted</p>
<p class="bg-status-info-emphasized text-on-status-info-emphasized p-small">Text on-status-info-emphasized</p>
<p class="bg-status-info-muted text-on-status-info-muted p-small">Text on-status-info-muted</p>
<p class="bg-status-negative-emphasized text-on-status-negative-emphasized p-small">Text on-status-negative-emphasized</p>
<p class="bg-status-negative-muted text-on-status-negative-muted p-small">Text on-status-negative-muted</p>
<p class="bg-status-positive-emphasized text-on-status-positive-emphasized p-small">Text on-status-positive-emphasized</p>
<p class="bg-status-positive-muted text-on-status-positive-muted p-small">Text on-status-positive-muted</p>
<p class="bg-status-warning-emphasized text-on-status-warning-emphasized p-small">Text on-status-warning-emphasized</p>
<p class="bg-status-warning-muted text-on-status-warning-muted p-small">Text on-status-warning-muted</p>
<p class="text-status-accent p-small">Text status-accent</p>
<p class="text-status-info p-small">Text status-info</p>
<p class="text-status-negative p-small">Text status-negative</p>
<p class="text-status-positive p-small">Text status-positive</p>
<p class="text-status-warning p-small">Text status-warning</p>
<p class="text-always-black p-small">Text always-black</p>
<p class="text-always-white p-small">Text always-white</p>
<p class="text-always-on-black bg-always-black p-small">Text always-on-black</p>
<p class="text-always-on-white bg-always-white p-small">Text always-on-white</p>
Bootstrap
$enable-bootstrap-compatibility: true
This part is enabled only when $enable-bootstrap-compatibility is set to true. Read more about Bootstrap compatibility.
.text-primary
.text-primary-emphasis
.text-secondary
.text-secondary-emphasis
.text-success
.text-success-emphasis
.text-danger
.text-danger-emphasis
.text-warning
.text-warning-emphasis
.text-info
.text-info-emphasis
.text-light
.text-light-emphasis
.text-dark
.text-dark-emphasis
.text-body
.text-body-emphasis
.text-body-secondary
.text-body-tertiary
.text-black
.text-white
.text-black-50
.text-white-50
<p class="text-primary">.text-primary</p>
<p class="text-primary-emphasis">.text-primary-emphasis</p>
<p class="text-secondary">.text-secondary</p>
<p class="text-secondary-emphasis">.text-secondary-emphasis</p>
<p class="text-success">.text-success</p>
<p class="text-success-emphasis">.text-success-emphasis</p>
<p class="text-danger">.text-danger</p>
<p class="text-danger-emphasis">.text-danger-emphasis</p>
<p class="text-warning bg-black">.text-warning</p>
<p class="text-warning-emphasis bg-black">.text-warning-emphasis</p>
<p class="text-info">.text-info</p>
<p class="text-info-emphasis">.text-info-emphasis</p>
<p class="text-light">.text-light</p>
<p class="text-light-emphasis">.text-light-emphasis</p>
<p class="text-dark">.text-dark</p>
<p class="text-dark-emphasis">.text-dark-emphasis</p>
<p class="text-body">.text-body</p>
<p class="text-body-emphasis">.text-body-emphasis</p>
<p class="text-body-secondary">.text-body-secondary</p>
<p class="text-body-tertiary">.text-body-tertiary</p>
<p class="text-black bg-white">.text-black</p>
<p class="text-white bg-black">.text-white</p>
<p class="text-black-50">.text-black-50</p>
<p class="text-white-50">.text-white-50</p> On icons
See icons documentation to learn how to use color utilities on icons.
Specificity
Sometimes contextual classes cannot be applied due to the specificity of another selector. In some cases, a sufficient workaround is to wrap your element’s content in a <div> or more semantic element with the desired class.