arrow_back
Back to Curriculum
palette
Tailwind CSS
Utility-first CSS framework concepts, highly requested by modern frontend roles.
Interview Questions
3 TotalQ1.
What is the core philosophy of a Utility-First CSS framework like Tailwind?
Instead of writing semantic CSS classes (like `.btn-primary`), we build designs directly in our HTML using composed, pre-existing low-level utility classes (like `bg-blue-500 text-white p-4`).
Q2.
How does Tailwind optimize CSS for production?
Tailwind uses a compiler (like PurgeCSS) that scans all HTML, JS, and Blade files for used class names. It then removes all unused CSS from the final bundle, often resulting in files smaller than 10kb.
Q3.
How do you handle arbitrary values in Tailwind CSS?
We can use square brackets to generate dynamic utility classes on the fly, for example: `w-[450px]` or `bg-[#ff0000]`.