Interview Q&A · questions with model answers

Tailwind CSS Interview Questions

Part of the study plan for: Frontend Engineer

Ordered by how often they're asked. Most-asked answers are free to read in full; members see every answer and can rate their confidence on each.

  1. Most asked How does Tailwind decide which CSS to generate?

    It scans your source files as plain text for anything that looks like a class name and generates CSS only for those, so the output contains just what you use. In v4 detection is automatic…

  2. Most asked Explain Tailwind's responsive design approach.

    Mobile first: unprefixed utilities apply to all sizes; breakpoint prefixes (sm:, md:, lg:, xl:, 2xl:) apply from that minimum width upwards. Design the phone layout first, then add prefixes for…

  3. Most asked How do variants like hover:, focus-visible:, group- and peer- work?

    Variants apply a utility only in a state: hover:bg-sky-600. group marks a parent so children react to its state (group-hover:); peer marks an element so later siblings react to it (peer-checked:,…

  4. If an element has class="p-4 p-2", which wins? How do you handle overrides in components?

    The utility that appears later in the generated stylesheet wins, regardless of order in the class attribute. For component overrides, merge classes with tailwind-merge or expose explicit variants…

  5. How do opacity modifiers and the colour palette work in v4?

    In Tailwind CSS v4, every built-in colour comes with shades from 50 to 950 defined in the OKLCH colour space for perceptually uniform gradients. You apply opacity using the /NN modifier directly on…

Was this page helpful?

Report a mistake