Since implementing Tailwind CSS in my React/Next.js project, I've noticed a decrease in maintainability compared to using traditional CSS or styled-components. Previously, I could easily consolidate style changes, but now I find myself duplicating classes for similar styling as shown below:
<div>
<p className='text-[16px] text-red-700'>one</p>
<p className='text-[16px] text-red-700'>two</p>
<p className='text-[16px] text-red-700'>three</p>
</div>
This duplication of code makes it challenging to consistently update styles across the project. What are the recommended practices for utilizing Tailwind CSS in React/Next.js to maintain a centralized source of truth for styling, akin to traditional CSS or styled-components?
I'm striving to improve the cleanliness and maintainability of my code while harnessing the capabilities of Tailwind CSS. Any insights or examples would be greatly valued. Thank you!