Tailwind CSS interview question · Most asked
What is Tailwind CSS and what does 'utility-first' mean?
Summary
Tailwind is a CSS framework of small, single-purpose classes (utilities) such as p-4, flex and text-sky-600. Utility-first means you build designs by combining these classes in your markup instead of writing custom CSS classes per component.
Longer Answer
Benefits: no naming, no context switching, consistent design from a shared scale, small CSS (only used classes are generated), and changes that can't break other pages. The trade-off is longer class lists, handled by extracting components.
Key Points
- Single-purpose classes.
- Compose in markup.
- Consistent scale.
- Components handle repetition.
Explanation
What interviewers look for
Clear definition plus honest trade-offs.
More most-asked Tailwind CSS questions
- Explain Tailwind's responsive design approach.
- How does Tailwind decide which CSS to generate?
- Why doesn't className={`bg-${color}-500`} work, and what should you do instead?
- How do you customize Tailwind's design tokens in v4?
- How do you avoid repeating long class lists?
- What changed in Tailwind CSS v4 compared with v3?
- How do you make Tailwind interfaces accessible?
- How does Tailwind compare with Bootstrap or writing your own CSS?