正在加载视频...
视频加载失败
Tailwind devs: You don't need clsx to toggle styles 👀
10 条评论

maybe just don't use tailwind at all

Boost, surf, and weave your way through The Art of Flight, an arcade game about flying multiple ships at the same time. With solo, local co-op, and a leaderboard, there are tons of ways to play. Wishlist on Steam today!

Yep, my favorite way to do it

Now you have two problems, clsx works fine and you can use plain objects instead of nested tenarry

Why do i the feeling clsx is still better

We can use objects within clsx. I think that helps dealing clutters

Nice

I think that depends - if you’re using JS to set the attribute anyway (it’s not some built in state) why not use JS to update classes and have smaller stylesheet with more performant classes and less risk of styles collision? But you must avoid twMerge for this to make sense 😄

The correct way IMO

YDKCLSX.

