Use a text color utility for the foreground
Tailwind’s color reference documents text utilities for setting CSS color. Try text-slate-700 on a short label with a known light background. Change the text and background one at a time so you can see which choice changes contrast.
Choose a color token that fits the content role
Tailwind’s current documentation connects its color utilities to theme variables. In an existing project, inspect the actual configuration and Tailwind version before adding a new token. Use the same token for repeated status labels whose meaning is the same, and keep the status readable in words.
Proof the real component in both modes
Check the foreground against the actual background for a default label, a link and a status message. Include a narrow view and keyboard focus where relevant. Use the Tailwind font guide for family selection and the homepage text styles for a separate copyable caption.
Your questions, answered.
Does a text color utility also set the background?
It sets the foreground color. Choose and proof the background separately.
Why can the same shade look different in another project?
Check the installed Tailwind version and the project’s theme values.
Sources & background
Sources supporting this page’s explanations. Practical examples are our editorial suggestions.