Recently, while learning Next.js (Reactjs) & developing a dashboard using shadcn/ui, I thought of experimenting with Tailwind CSS. After using a couple of ready-made UI components built with Tailwind CSS & learning about different classes like Grid, Flex, Border etc, I was pleasantly surprised to see significantly faster development & improved workflow. One must definitely try using it!
Find below the examples implementing the Tailwind tips & tricks.
1. Delegate classes
Instead of using text-* on each li, we can simply use the same class on the ul.
Recently, while learning Next.js (Reactjs) & developing a dashboard using shadcn/ui, I thought of experimenting with Tailwind CSS. After using a couple of ready-made UI components built with Tailwind CSS & learning about different classes like Grid, Flex, Border etc, I was pleasantly surprised to see significantly faster development & improved workflow. One must definitely try using it!
Find below the examples implementing the Tailwind tips & tricks.
1. Delegate classes
Instead of using text-* on each li, we can simply use the same class on the ul.
2. Space between elements
Instead of using gap, margin, padding property on each child for space, we can use the space-x-, space-y- property on just the parent.
Where Find Me