Backdrops provide a useful design pattern—placing a translucent image behind contextual content. Backdrops offer two distinct style variants: Image proportional and fixed height.
Accessibility Spotlight
Backdrops remove the need for CSS background images. Feature images exist within the HTML, so screen readers can read the text of the image's alt attribute.
Image Proportional
Image proportional backdrops scale and stack responsively. Below is an example of a basic image proportional backdrop.
The .theme-dark utility class is optional. It provides the background and text color. If not present, these colors are inherited from the backdrop's nearest ancestor (with a theme color applied).
The size of this backdrop (proportional width and height) is determined by the size of its feature image.
The translucent effect of the backdrop is acheived with the use of additional utility classes. Our theme color utilities (e.g. .theme-dark) provide the background and text color. The opacity utility class (e.g. .opacity-30) applied to the backdrop's feature image, allows the background color to show through.
Stack Breakpoint Modifiers
When using image size proportional backdrops for featured content (like the full-width example below) the backdrop may become too tall for the image on smaller viewport sizes.
To occomodate small viewports, include a stack breakpoint modifier (e.g. .backdrop--stack--{x}) to the .backdrop selector. Where x equals the desired breakpoint (e.g., lg for large). The backdrop's image is placed above the content vertically until the viewport reaches the desired breakpoint specified in the modifier.
The above example shows how the same full-with backdrop appears on a smaller (mobile) viewport.
Notice, too, the image is at full opacity. That's because our opacity classes have their own a breakpoint modifiers. Adding .opacity-40--lg to the .backdrop__image selector gives that image a specified opacity (40%) at the large (lg) breakpoint.
Figure 2 (below) provides code used to create the backdrop above. Refer specifically to line 1, where the .backdrop--stack--lg breakpoint modifier is present.
All of this together makes it easy to create responsive backdrops with different flavors of color and content. What if we don't want our backdrop's size to be dictated by its feature image?
Fixed Height
Fixed height backdrops retain their height across viewport sizes. When needed, they adjust to the height of their inner content.
For a fixed height backdrop, append the .backdrop--fixed modifier to the .backdrop selector.
Emily Elizabeth Dickinson was an American poet. Little-known during her life, she has since been regarded as one of the most important figures in American poetry.
Dickinson was born in Amherst, Massachusetts into a prominent family with strong ties to its community.