yellow
- Class
.bg-yellow
Sorry, but you either have no stories or none are selected somehow.
If the problem persists, check the browser console, or the terminal you've run Storybook from.
The component failed to render properly, likely due to a configuration issue in Storybook. Here are some common causes and how you can address them:
The background utilities are deprecated and will be removed in a future version.
Use the background utility classes to set the background of an element to any predefined color.
Background utilities also set the text color by defining the following CSS variables:
--post-contrast-color and --post-contrast-color-rgb--post-contrast-color-inverted and --post-contrast-color-inverted-rgbTo set a background on an element, simply add a .bg-{colorname} class to it.
<div class="bg-yellow p-3">Content</div>
.bg-yellow.bg-white.bg-light.bg-gray.bg-dark.bg-black.bg-primary.bg-secondary.bg-success.bg-warning.bg-error.bg-info.bg-success-background.bg-warning-background.bg-error-background.bg-nightblue.bg-nightblue-bright.bg-petrol.bg-petrol-bright.bg-coral.bg-coral-bright.bg-olive.bg-olive-bright.bg-purple.bg-purple-bright.bg-aubergine.bg-aubergine-brightIt is possible to nest backgrounds.
Text color and inverted text color CSS variables are set for each background to always ensure the best possible contrast.
.bg-gray
container.
.bg-dark
container.
.bg-light
container.
<div class="bg-gray p-3"> Content in <code>.bg-gray</code> container. <div class="bg-dark p-3"> Content in <code>.bg-dark</code> container. <div class="bg-light p-3"> Content in <code>.bg-light</code> container. </div> </div> </div>
Change the background opacity simply by setting the CSS variable --post-bg-opacity.
Low background opacity is not recommended as it can lead to poor contrast. It is then your responsibility to ensure that the contrast ratio between foreground and background is at least 4.5:1. More information on that topic is available on our accessibility docs.
<div class="bg-aubergine p-3">Container with default opacity (1).</div> <div class="bg-aubergine p-3" style="--post-bg-opacity: 0.8">Container with opacity 0.8.</div> <div class="bg-aubergine p-3" style="--post-bg-opacity: 0.6">Container with opacity 0.6.</div> <div class="bg-aubergine p-3" style="--post-bg-opacity: 0.4">Container with opacity 0.4.</div> <div class="bg-aubergine p-3" style="--post-bg-opacity: 0.2">Container with opacity 0.2.</div>