logoalt Hacker News

Klonoarlast Friday at 12:01 AM2 repliesview on HN

> Just about everyone uses component-specific styles

Yeah.

At which point you can simply use e.g Tailwind.


Replies

Lalabadielast Friday at 12:33 AM

What component-specific styles look like:

class="menu-item"

Styles-in-HTML (Tailwind):

class="m-4 mb-2 p-2 border border-radius-sm border gray-200 hover:border-gray-300 font-sm sm:font-xs [...]"

You can be completely insensitive to or unbothered by the difference, but that doesn't mean they're equivalent.

spankaleelast Friday at 1:36 AM

No, because many components have internals that need to be styled consistently with parts of other components.

With plain CSS components can easily share styles and use them by adding the correct class name to elements.

With Tailwind you have to copy your list of super fine-grained classes to each component, and try to keep them in sync over time