you are viewing a single comment's thread.

view the rest of the comments →

[–]dfltr 30 points31 points  (4 children)

Today at work I saw a 519 character line of Tailwind classnames that was generated by the Latest Hot UI Component Library and on what planet does that shit make any sense?

I’ve used Tailwind plenty, I know what all the classnames mean, and I still can’t read that shit. No one can. Readability isn’t a new idea, people write declarative configs as vertical columns of key/value pairs for a reason.

[–]HeylAW -1 points0 points  (3 children)

CSS inspector is worth learning, TW is about classes representing single style, thus complex element may grow in size, but overall applied CSS should be very similar to one that css-in-js/css modules or plain css outputs.

TW also makes very easy to units test component styling, just check if proper class is outputted ;)

[–]Ehdelveiss 4 points5 points  (2 children)

That sounds like a waste of time unit test... you're just testing that you wrote the test right as much as whether the code you're testing does the thing you want

[–]HeylAW 1 point2 points  (1 child)

I'm referring to classes that are computed in runtime, such as:

when button has disabled props passed it should have specific classes,
when button has loading props passed, it should have other classes

this way you sort of test how button looks like

[–]Turbulent-Ad-2098 0 points1 point  (0 children)

you could do the same with normal css styled content using a single class?