utility class

A CSS class that does one small job, such as p-4 for padding or text-white for text colour.

In more detail

Utility classes are combined in the class attribute instead of writing a custom stylesheet per component. In Tailwind version 4 each colour utility reads a theme variable, so bg-brand means background-color: var(--color-brand).

Example

In the browser: Utility-first CSS frameworks are built almost entirely from such classes. Utilities usually live in the last cascade layer so they always win over components, regardless of specificity.

Related terms

Taught in

References