Dev Helpers

Tailwind CSS / Accessibility and international layouts

Always allow selection of a reference code

Dev Helpers · September 11, 2026

Selection utilities can restore copying on one field inside a larger interactive card. Apply the exception to the exact text the reader needs.

Worked example

<code class="demo select-all">ORDER-2026-014</code>

Implementation notes

A copyable token inside a draggable card needs separate hit testing. Text selection should remain possible without firing the card's primary action.

Try it yourself

Try selecting the code and then a neighbouring button label.

Open the Tailwind CSS example →

Editorial date September 11, 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.