Dev Helpers

Tailwind CSS / Colour and backgrounds

Tint only the background

Dev Helpers · August 29, 2026

A background colour with an alpha component preserves the opacity of text and icons. This is particularly useful for labels over photographs.

Worked example

<div class="demo bg-[#14b8a6]/20">Tint only the background</div>

Implementation notes

Layering two translucent surfaces compounds their colours. Test the finished component against the real photo or page surface rather than a neutral swatch.

Try it yourself

Compare the label over the brightest and darkest parts of an image.

Open the Tailwind CSS example →

Editorial date August 29, 2026 · Published December 6, 2026

Related articles

Selection background swatch

The selection variant lets a component specify its own selected-text colours. Readability depends on the selected foreground as well as the highlight.

Skew a label

A skew utility changes the painted shape without allocating extra room for the slanted edge. A separate inner wrapper can keep lettering upright.

Horizontal flex row

Flex utilities define the row but children can still resist shrinking. Inspect long labels before adding more breakpoints.