5:40 you can also use tailwind-merge with clsx for conditional styles , Its a good combo
@bioburden4 ай бұрын
Thanks for quickly explaining cva, I was struggling to know the best way of implementing a design system with Tailwind.
@nested93015 ай бұрын
I always turn everything into separate components it's the core of react
@smoothoperatah5 ай бұрын
always? everything? that sounds tedious
@treyrader5 ай бұрын
Only do that if you find yourself needing to reuse the div. I use tw merge and clsx and thn wrap things in the cn() function divided by commas. (eg 'cn("flex", "items-center", "justify-center", {"hidden": !isActive});'. I also use the layer directive and add all my combo classnames, such as "flex-center": "flex items-center justify-center"; It goes a longg way. Used to store the classnames in a separate module but it proved to be difficult to make modifications nor did i get the intellisense. I fucking love tailwind so much
@kartikm75 ай бұрын
Great content man, always getting learn something new from here!
@blu_ey5 ай бұрын
I use tailwind-variants instead of cva, it has slots and automatically uses twMerge
@tomisloading5 ай бұрын
I’ll check that out!
@joshuadeguzman29115 ай бұрын
I think it would be better to create an array of links if links have similar styles except for active status. It'll make it easier to add new links and style them similarly and could simply highlight the active link.
@slliks45 ай бұрын
Or repeat in a more fancy way Create an array of dic with the link name as a key Map through it in your jxs and just style one of the tag
@Dreamslol5 ай бұрын
The buttons look so cute!
@slliks45 ай бұрын
Overriding is still a flex complex thing for me 😅 I just write CSS code if it Gets too complex
@victorshirokiy98835 ай бұрын
Instead of variants logic, you can define custom classes with {@apply: bg-white text-black ...}
@0xAndy5 ай бұрын
Love this channel.
@tomisloading5 ай бұрын
Thank you! 😁
@obasaajibola39335 ай бұрын
please create an awwwards like preloader animation on your next video with framer-motion and react or nextjs
@felipefregginrules5 ай бұрын
Love this!
@Howdyhowthis5 ай бұрын
Cant we just do css module and use @component.
@daleryanaldover65455 ай бұрын
Finally found Tom, the maker of JDSL 😂
@ofeklevy12425 ай бұрын
GREAT
@mattmaloney59885 ай бұрын
Insane that anyone has the time per mental space to deal with this nonsense.