The Patterns That Separate Good Tailwind from Great Tailwind
Arbitrary values are a trap. If you're writing [margin-top:13px] frequently, you're fighting the design system instead of working with it. The right move is to adjust your design to use the scale — or, if the scale is genuinely wrong for your project, extend tailwind.config.js with your own values.
The group and peer modifiers are the most underused features in Tailwind. group-hover:text-white on a child element responds to hovering the parent. peer-checked:border-cyan-500 changes a sibling based on a checkbox state. These two patterns replace a large chunk of what you'd otherwise need JavaScript for.
Responsive Design the Tailwind Way
Tailwind is mobile-first. sm: means 'at 640px and above,' not 'on small screens.' This catches people out. The base styles are your mobile styles. Responsive prefixes are progressively wider. Write your layout for mobile first, then layer on the wider breakpoint overrides.
The container component in Tailwind is often configured wrong. The default has no horizontal padding and centres only at specific breakpoints. In tailwind.config.js, set container.center: true and container.padding with appropriate values for each breakpoint — this one config change makes container behave the way most people expect.
Key takeaways
- Learn group, peer, and has modifiers — they enable hover, focus, and checked states on related elements without JavaScript
- Tailwind is mobile-first: base styles apply to all sizes, responsive prefixes (sm:, md:, lg:) override at wider viewports — design mobile layout first
- Extend tailwind.config.js for brand-specific values rather than using arbitrary values in classes — this keeps the design system consistent and enables tooling like IntelliSense to work correctly
Conclusion
Mastering Tailwind isn't memorising class names — it's understanding the design system it enforces and learning to work with that constraint productively. The constraint is the point.
Enjoyed this article?

Vivek Kumar Singh
Technical Expert · Full Stack Cloud Engineer · Tokyo, Japan