Common Tailwind CSS interview questions
1. What is utility-first CSS?
A styling approach that composes small single-purpose classes directly in markup.
2. How does responsive design work in Tailwind?
Base utilities apply by default, and breakpoint variants apply from their configured minimum width upward.
3. Why can dynamically constructed classes fail?
The complete class candidate may not appear in scanned source, so the build may not generate its CSS.
4. Is Tailwind a replacement for CSS?
No. It generates CSS utilities and still relies on CSS layout, cascade, and browser rendering.
5. How do you handle repeated UI patterns?
Use components or explicit variant maps when they create meaningful reuse, consistent behavior, or a stable API.
6. How do you debug a missing style?
Check the DOM class, candidate detection, generated rule, computed styles, cascade, and parent layout constraints.
7. How do you make a UI accessible?
Use semantic HTML, labels, visible keyboard focus, adequate contrast, correct states, and reduced-motion support where relevant.
8. What changed between v3 and v4?
The setup and configuration model changed, including a stronger CSS-first workflow in v4. Follow the migration guide for exact details.
Which statement about Tailwind CSS is correct?