正在加载视频...

视频加载失败

Tailwind devs: You don't need clsx to toggle styles 👀

35,970 次观看 • 1 年前 •via X (Twitter)

10 条评论

IroncladDev 的头像
IroncladDev1 年前

maybe just don't use tailwind at all

Page to Pixel Publishing 的头像
Page to Pixel Publishing2 年前

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!

simeonGriggs 的头像
simeonGriggs1 年前

Yep, my favorite way to do it

Navicstein Chinemerem 的头像
Navicstein Chinemerem1 年前

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

Gokuljs 的头像
Gokuljs1 年前

Why do i the feeling clsx is still better

Ömer Ayhan 的头像
Ömer Ayhan1 年前

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

Taz 的头像
Taz1 年前

Nice

Paweł Błaszczyk 的头像
Paweł Błaszczyk1 年前

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 😄

Pedro Martins 的头像
Pedro Martins1 年前

The correct way IMO

Mohamad Jahani 的头像
Mohamad Jahani1 年前

YDKCLSX.

相关视频

Need to vent... don't listen if you don't want to
1:50

Sensitive content

Need to vent... don't listen if you don't want to

Secretgeek

18,051 次观看 • 1 年前