Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> container styles from earlier might look something like “container mt-5 mb-5 p-20” in one place and “container mb-30 mt-30” or “container bg-dark pt-5”

I've only used Tailwind briefly for some side project, but I thought the docs made it clear that whenever you have a situation where you feel you're repeating styles you should extract them into a new CSS class. There's a whole section dedicated to that in the docs:

https://tailwindcss.com/docs/extracting-components

How would this have been prevented if those same developers weren't using Tailwind and instead simply created .container1, .container2, and .container3?

> Now that we build with small, immutable, scoped components

What do you mean by the word component? Are you talking about a React or <insert framework here> component? I don't really see how it's related. It seems like your team quickly iterated and didn't think forward about creating a common look for "containers" until a good amount of development was done. The common look could have been accomplished by extracting the common styles like the above link suggests or creating a common "Container" UI component with isolated styles. The mistake was not thinking ahead and seems unrelated to Tailwind IMHO.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: