CSS in real projects · mid
Styling approaches: BEM, CSS Modules, CSS-in-JS, Tailwind
Each approach solves global-CSS collisions differently: BEM by naming, CSS Modules by build-time scoping, runtime CSS-in-JS by generating styles in JS (with a runtime cost and Server Component problems), and Tailwind by utility classes compiled at build time.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
- BEM: .card__title--active; zero tooling, relies on discipline.
- CSS Modules: locally scoped class names, plain CSS, works with Server Components.
- Runtime CSS-in-JS (styled-components, Emotion) injects styles at runtime; costs performance and doesn't fit React Server Components; zero-runtime options (vanilla-extract, Panda, StyleX) compile away.
- Tailwind: utility classes, design tokens in config/CSS, tiny output; risk is long class lists, so extract components.
- A senior answer ties the choice to team, performance and SSR needs.
The red pen
Common traps: mistake → fix
Mistake: "CSS-in-JS is free"
Fix: runtime libraries add JS and work during render.
Easy to hard
Questions interviewers ask, easy to hard
- Compare BEM, CSS Modules, CSS-in-JS and Tailwind.
- What would you pick for a Next.js App Router app and why?
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.