DEV Community

Discussion on: Increase tailwind classes readability with this eslint plugin

Collapse
 
oliyg profile image
OliverYoung

It's too long and most of the time I need multiple lines. So why not just give it a scoped classname, it will make my html cleaner.

Thread Thread
 
kalimahapps profile image
Kalimah Apps

I thought you are referring to the plugin not Tailwind. I have to say that I shared your opinion before I started using tailwind but after researching a bit and in particular reading this article (by the creator of tailwind) adamwathan.me/css-utility-classes-... I switched. And I have to say it was a very good decision for me.

It works best if you have a build process in your project. So if you are using vue, react .. etc with node it works very well.

At the end of the day, we should not focus on the technology but the project requirements.

Thread Thread
 
oliyg profile image
OliverYoung

Really good article. I have to admit, there are some advantages I really enjoy.

I don't need to come up with a name, I can focus on the style itself. It forces me to create a usable component when I try to write multiples of the same class name, which is a great way to force me to write reusable CSS styles. Before reading this article I thought it was the same as inline-style, but now I realize that arbitrary values are not recommended and we should use the value from the list.

But I'm finding it hard to inspect elements, since the elements don't have it's name.

Or I should try a few more times, maybe I'm just not familiar with the class names or didn't define tailwind.config.js carefully.