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

I've been using CSS Modules as well as Shadow DOM for styling for about 2 years now after ditching SCSS. I've switched over to using Shadow DOM and things like Constructable Stylesheets, but CSS Modules is still one of the best options for compatibility and ease of use (no boundary restrictions being the main one).

I've tried to like TailwindCSS. I tried to use it on a project and I just found it so complicated and messy. People are quick to say, "Oh, give it time, eventually you don't need to consult the documentation as much" which is a strange thing to me, because for normal CSS it's rare I do have to consult MDN to know something (unless it's CSS Grid syntax). If you're new to Tailwind be prepared to waste hours just consulting documentation until "it clicks". You're basically learning a new language on top of CSS. And then the resulting markup in some Tailwind apps I've seen isn't easy to read, it ends up being no different than the randomised classes that CSS Modules gives you.

CSS Modules work perfectly with design systems and other CSS additions. I even use CSS Modules with Bootstrap 5, it works well.

I'm not saying Tailwind is bad, but there is a curve when you use it. It' also feels very boilerplate-y, which I know the React crowd loves, but I don't work with React. Given the amount of work I have on my plate, I would rather stick with my current approach than lose hours in productivity because I want to change how I write my CSS.



For me reading documentation is the major part of the development process and having a good experience and a reduced palette of options helps a lot. I have used css for years but never really learned it properly. I would spend ages trying to debug issues on various css documentation sites. I find that tailwind just has a solution for everything and I rarely need to go outside the Tailwind documentation. I think it helps develop your way of thinking. And one day I might grow out of it and return to normal css with a better perspective. Obviously I should just go an learn CSS properly, but I probably won't.


How did you learn the CSS properties without consulting documentation? I get that you don't need to consult MDN every _now_, but imagine you were just learning. You'd likely need MDN very often. I still consult MDN for the syntax of some of the more advanced properties.


Yeah, the difference is that once you know them, you can use them on literally every project until CSS somehow gets replaced with something else (which will never happen).

If you put all that time into learning the tailwind shorthand then you're fucked on the next project that doesn't use it.

Personally I'd prefer to not have to re-learn how to style things on every damn project just because some noobs that have to pay the learning cost anyway think they've found some 5% efficiency with some shit library.


Do you also not learn new programming languages for fear of not using them on the next project? Your words are really aggressive. Try to have a more open mind.




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

Search: