Code
.text-muted
.text|bg-primary
.text|bg-success
.text|bg-info
.text|bg-warning
.text|bg-danger
.text|bg-secondary
.text|bg-white
.text|bg-dark
.text-body
.text|bg-light
.text-bg-*
Definitions
- Muted
- ▪ Distinguishes less important information from the main text. (#6c757d)
- Primary
- ▪ Conveys that this text is important. (#0d6efd)
- Success
- ▪ Indicates a successful interaction. (#198754)
- Info
- ▪ Used to relate some information. (#0dcaf0)
- Warning
- ▪ Represents a warning. (#ffc107)
- Danger
- ▪ Indicates danger. (#dc3545)
- Secondary
- ▪ Creates smaller, secondary text in any heading. ($gray-600: #6c757d)
- White
- ▪ Used mostly for dark backgrounds/themes. (#fff)
- Dark
- ▪ Ideal for lighter backgrounds/themes. ($gray-900: #212529)
- Body
- ▪ This is the default body color, often just black/dark. ($gray-900: #212529)
- Light
- ▪ Used mostly on darker backgrounds, this is a light gray text. ($gray-100: #f8f9fa)
Key Points
- Referred to as contextual classes as they add meaning through colors.
- Contextual classes can be used on text or backgrounds.
- Each contextual class has a background except Muted and Body.
- You can use
.link-*
classes to colorize links. These classes add a:hover
and a:focus
state, unlike.text-*
. - You can add 50% opacity to black or white text with
.text-black-50
ortext-white-50
.