Tailwind CSS interview question · Most asked

How do you set up Tailwind CSS v4 in a project?

Create a free account to save this page, take notes and track your progress. Sign in

Summary

Install tailwindcss with the integration for your build tool (@tailwindcss/vite, @tailwindcss/postcss, or @tailwindcss/cli), and add @import "tailwindcss"; to your main CSS file. Class detection is automatic; there's no required config file.

Longer Answer

For prototypes, the Play CDN script compiles in the browser, but it isn't for production. Projects coming from v3 can keep a JavaScript config with @config.

Key Points

  • Vite plugin, PostCSS plugin or CLI.
  • @import "tailwindcss".
  • Automatic detection.
  • Play CDN only for prototypes.

Deep dive: Tailwind CSS Tutorial: Get Started with Tailwind CSS

Explanation

What interviewers look for

Knows v4's simpler setup.

More most-asked Tailwind CSS questions

← All Tailwind CSS questions

Was this page helpful?