Question 16
How do you handle design tokens with Tailwind?
Define shared tokens in theme config (colors, spacing, font sizes) or CSS variables, then reference them through utilities.
This keeps UI consistent and easier to evolve.
Question 16
Define shared tokens in theme config (colors, spacing, font sizes) or CSS variables, then reference them through utilities.
This keeps UI consistent and easier to evolve.
Question 17
Use visible keyboard focus classes such as focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cyan-500.
Never remove focus indication without adding a strong replacement.
Question 18
Question 19
Use utilities like clsx with booleans.
Example:
className={clsx("rounded-xl px-4 py-2", isActive ? "bg-cyan-700" : "bg-slate-200")}
Question 20
It provides sensible prose defaults for content-rich markdown/HTML blocks.
Great for blog posts, docs, and Q&A answers where plain utilities are verbose.
Question 21
Define keyframes and animation names in Tailwind config (or CSS layer), then use utility classes like animate-fade-in.
Keep motion subtle and respect reduced-motion preferences.
Question 22
Tailwind v4 shifts configuration and authoring ergonomics compared to earlier versions, with stronger CSS-variable patterns and updated directives.
When working in an existing project, follow the repo's established Tailwind syntax and conventions.
Question 23
Question 24
Use custom CSS for complex keyframes, third-party overrides, advanced selectors, or patterns that are hard to express cleanly in utilities.
Tailwind and custom CSS should complement each other.
Question 25
Migrate component-by-component, keeping visual parity first. Replace repeated CSS patterns with utility composition and shared components.
Avoid big-bang rewrites that are difficult to validate.
Question 26
Include all template/source directories where class names appear. Missing paths cause classes to be purged from build output.
Question 27
Safelisting preserves classes that might be generated dynamically and not discoverable in static scans.
Question 28
Class scanners may not detect runtime-generated strings, leading to missing styles in production.
Question 29
Map state to explicit class strings in objects instead of constructing arbitrary strings at runtime.
Question 30
Use design tokens, component wrappers, and utility conventions reviewed by code guidelines.