Colors
Convey meaning through color with a handful of color utility classes. Includes support for styling links with hover states, too.
Overview
Arizona Bootstrap offers two “types” or colors: Brand colors and contextual (theme) colors. Brand colors are a collection of Arizona Branded colors offered by the Brand website. Contextual colors are a smaller selection of Brand colors that are used to convey meaning and contextual information (e.g., success, warning, danger).
When using these colors, it is important to maintain sufficient color contrast between your text color and background color. You can utilize the WebAim Color Contrast Checker to verify your color contrast. Or, for your convenience, Arizona Bootstrap also provides a helpful tool to determine which Brand text colors have sufficient color contrast on other Brand background colors.
Text Color
Brand
.text-red
.text-bloom
.text-chili
.text-blue
.text-sky
.text-oasis
.text-azurite
.text-midnight
.text-cool-gray
.text-warm-gray
.text-leaf
.text-river
.text-silver
.text-mesa
.text-ash
.text-sage
.text-white
.text-black
<p class="text-red">.text-red</p>
<p class="text-bloom">.text-bloom</p>
<p class="text-chili">.text-chili</p>
<p class="text-blue">.text-blue</p>
<p class="text-sky">.text-sky</p>
<p class="text-oasis">.text-oasis</p>
<p class="text-azurite">.text-azurite</p>
<p class="text-midnight">.text-midnight</p>
<p class="text-cool-gray bg-dark">.text-cool-gray</p>
<p class="text-warm-gray bg-dark">.text-warm-gray</p>
<p class="text-leaf">.text-leaf</p>
<p class="text-river">.text-river</p>
<p class="text-silver">.text-silver</p>
<p class="text-mesa">.text-mesa</p>
<p class="text-ash">.text-ash</p>
<p class="text-sage">.text-sage</p>
<p class="text-white bg-dark">.text-white</p>
<p class="text-black">.text-black</p>
Contextual (Theme)
.text-success
.text-danger
.text-warning
.text-info
.text-light
.text-dark
.text-body
.text-muted
.text-black-50
.text-white-50
<p class="text-success">.text-success</p>
<p class="text-danger">.text-danger</p>
<p class="text-warning">.text-warning</p>
<p class="text-info">.text-info</p>
<p class="text-light bg-dark">.text-light</p>
<p class="text-dark">.text-dark</p>
<p class="text-body">.text-body</p>
<p class="text-muted">.text-muted</p>
<p class="text-black-50">.text-black-50</p>
<p class="text-white-50 bg-dark">.text-white-50</p>
Contextual text classes also work well on anchors with the provided hover and focus states. Note that the .text-white
and .text-muted
class has no additional link styling beyond underline.
<p><a href="#" class="text-success">Success link</a></p>
<p><a href="#" class="text-danger">Danger link</a></p>
<p><a href="#" class="text-warning">Warning link</a></p>
<p><a href="#" class="text-info">Info link</a></p>
<p><a href="#" class="text-light bg-dark">Light link</a></p>
<p><a href="#" class="text-dark">Dark link</a></p>
<p><a href="#" class="text-muted">Muted link</a></p>
<p><a href="#" class="text-white bg-dark">White link</a></p>
Background Color
Similar to the contextual text color classes, easily set the background of an element to any contextual class. Anchor components will darken on hover, just like the text classes. Background utilities do not set color
, so in some cases you’ll want to use .text-*
utilities.
Brand
<div class="p-3 mb-2 bg-red">.bg-red</div>
<div class="p-3 mb-2 bg-bloom">.bg-bloom</div>
<div class="p-3 mb-2 bg-chili">.bg-chili</div>
<div class="p-3 mb-2 bg-blue">.bg-blue</div>
<div class="p-3 mb-2 bg-sky">.bg-sky</div>
<div class="p-3 mb-2 bg-oasis">.bg-oasis</div>
<div class="p-3 mb-2 bg-azurite">.bg-azurite</div>
<div class="p-3 mb-2 bg-midnight">.bg-midnight</div>
<div class="p-3 mb-2 bg-cool-gray">.bg-cool-gray</div>
<div class="p-3 mb-2 bg-warm-gray">.bg-warm-gray</div>
<div class="p-3 mb-2 bg-leaf">.bg-leaf</div>
<div class="p-3 mb-2 bg-river">.bg-river</div>
<div class="p-3 mb-2 bg-silver">.bg-silver</div>
<div class="p-3 mb-2 bg-mesa">.bg-mesa</div>
<div class="p-3 mb-2 bg-ash">.bg-ash</div>
<div class="p-3 mb-2 bg-sage">.bg-sage</div>
<div class="p-3 mb-2 bg-white">.bg-white</div>
<div class="p-3 mb-2 bg-black">.bg-black</div>
Contextual (Theme)
<div class="p-3 mb-2 bg-success">.bg-success</div>
<div class="p-3 mb-2 bg-danger">.bg-danger</div>
<div class="p-3 mb-2 bg-warning">.bg-warning</div>
<div class="p-3 mb-2 bg-info">.bg-info</div>
<div class="p-3 mb-2 bg-light">.bg-light</div>
<div class="p-3 mb-2 bg-dark">.bg-dark</div>
<div class="p-3 mb-2 bg-transparent text-dark">.bg-transparent</div>
Grayscale
<div class="p-3 mb-2 bg-gray-100">.bg-gray-100</div>
<div class="p-3 mb-2 bg-gray-200">.bg-gray-200</div>
<div class="p-3 mb-2 bg-gray-300">.bg-gray-300</div>
<div class="p-3 mb-2 bg-gray-400">.bg-gray-400</div>
<div class="p-3 mb-2 bg-gray-500">.bg-gray-500</div>
<div class="p-3 mb-2 bg-gray-600">.bg-gray-600</div>
<div class="p-3 mb-2 bg-gray-700">.bg-gray-700</div>
<div class="p-3 mb-2 bg-gray-800">.bg-gray-800</div>
<div class="p-3 mb-2 bg-gray-900">.bg-gray-900</div>
Background Gradient
Use the bg-gradient-*
class to apply a gradient background from a color on the bottom to transparent on the top.
.bg-gradient-black
<h3 class="bold p-card pt-8 bg-gradient-black text-white">.bg-gradient-black</h3>
TWBS Original Information
When $enable-gradients
is set to true
(default is false
), you can use .bg-gradient-
utility classes. Learn about our Sass options to enable these classes and more.
Dealing with 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>
with the class.
Conveying meaning to assistive technologies
Using color to add meaning only provides a visual indication, which will not be conveyed to users of assistive technologies – such as screen readers. Ensure that information denoted by the color is either obvious from the content itself (e.g. the visible text), or is included through alternative means, such as additional text hidden with the .sr-only
class.