Tailwind CSS
/Intermediate
Custom Spacing
Definition
Extending Tailwind's default numerical spacing scale to include specific, non-standard measurements required by a design team.
Explain Like I'm New
Tailwind's scale goes like `p-4` (1rem), `p-5` (1.25rem). If your designer is obsessed with a massive 500px gap for a specific hero section, you don't write inline styles. You add `'hero': '500px'` to the spacing config, and now you can use `mt-hero` or `h-hero`.
Real World Example
Adding a `13` to the spacing scale because you specifically need exactly `3.25rem` for a highly specific card layout.
Common Use Cases
- •Pixel-perfect Figma translations
Interactive Example
Loading...
Console output will appear here...
Interview Questions
basic
- If you add `'custom': '200px'` to `theme.extend.spacing`, which classes are generated?
intermediate
- Why shouldn't you just use arbitrary values (like `w-[200px]`) instead of extending the config?