What are arbitrary values and when should you use them?
Assesses fundamental understanding of Tailwind CSS conventions, runtime behavior, and memory/performance considerations.
Hiring managers look for precision, avoidance of ambiguous jargon, and ability to explain trade-offs under real production conditions.
When a design needs a one-off value that is not in the scale, arbitrary value syntax accepts raw CSS inside square brackets: w-[327px], top-[117px], bg-[#1da1f2], grid-cols-[1fr_500px_2fr], where underscores become spaces, and content-['']. You can combine them with variants, for example lg:mt-[3.75rem].
<div class="h-[calc(100vh-4rem)] bg-[url('/hero.jpg')]">...</div>
The JIT engine reads these literals and generates the rule on demand, so there is no performance penalty and they purge correctly as long as they appear as strings in scanned files.
Arbitrary values are an escape hatch, not the default. Repeated magic numbers should be promoted into theme.extend so the design stays consistent and searchable. Arbitrary properties like [mask-type:luminance] and arbitrary variants like [&:nth-child(3)]:mt-4 extend this further, letting you reach almost any CSS without leaving the markup.
Candidate Response Strategy & Interview Tips
- Start with a concise one-sentence summary: Deliver a direct, confident answer first before expanding into nuances.
- Demonstrate real-world trade-offs: Discuss where this approach excels and when you would avoid it in production systems.
- Discuss complexity & edge cases: Proactively explain time/space complexity or boundary conditions (null values, scale limits).
- Prepare for interviewer follow-ups: Technical hiring panels frequently probe deeper into concurrency, backward compatibility, or alternative libraries.