Question presented to candidate: "What styling options does the App Router support, how are they bundled, and what are the trade-offs for Server Components?"
What a strong answer should cover:
- CSS Modules (
*.module.css) generate unique class names per file, so styles do not leak. - Global CSS can be imported from layouts, pages and components in the App Router; it applies to the whole app.
- Tailwind CSS works through PostCSS and generates utility classes at build time, with no runtime cost.
- Runtime CSS-in-JS libraries (styled-components, Emotion) need a style registry and Client Components; they do not work inside Server Components.
- CSS is extracted into static CSS files with long-lived cache headers and loaded with the route.
Clarifying questions expected:
- "Does the team use a component library with CSS-in-JS?" β it constrains Server Components.
- "Is there a design system already?" β Tailwind or CSS Modules fit Server Components best.
Code / implementation expected: Yes β a CSS Module and a global stylesheet.