Bootstrap 4 has some contextual classes that can be used to provide “meaning through colors”.
The classes for text colors are:
.text-body (default body-color/often black) and
This text is muted. This text is important. This text indicates success. This text represents some information. This text represents a warning. This text represents danger. Secondary text. Dark grey text. Body text. Light grey text.
You can also add 50% opacity for black or white text with the
Black text with 50% opacity on white background White text with 50% opacity on black background
The classes for background colors are:
Note that background colors do not set the text color, so in some cases, you’ll want to use them together with a
This text is important. This text indicates success. This text represents some information. This text represents a warning. This text represents danger. Secondary background color. Dark grey background color. Light grey background color.