a lot of the necessity for thins seems to come from the fact that people often forget to "actually" render just the right classnames when needed. instead of this: className={`bg-white px-4 py-2 ${someVar ? 'bg-black' : '' }`} do this: className={`px-4 py-2 ${someVar ? 'bg-black' : 'bg-white' }`} This is very simplified ofc, just illustrating
9:32 dynamic class is not working when restart project(npm run dev). tailwind do not leave class. / code sample className={twMerge(`mobile:${gnbActive ? "flex" : "hidden"}`)} please check up this.
I am done with tailwind. I have to use custom components. Well, twMerge do not recognize custom components of tailwind config, so if you want to use twmerge, you have to repeat all your custom classes configuation in twmerge config. And it has bugs, like twmerge("w-96", "w-full") is not working.
@@ByteGrad well I am maybe doing something really wrong because it is not overwriting it. I have the 2 classes and w-full is strikethrough. I saw the git discussions. There was a similar bug with w-fit and w-full. By the way, your content is awesome!
It's much faster to write using Tailwind's utility classes than inline JS, but also it makes your spacing, sizes, etc much more consistent and easier to work with. Having the styles on the same file as the component also makes it a lot easier to figure out what is going on so you don't have to back and forth between files, so yeah, using Tailwind is definitely NOT a mistake.
👉 NEW React & Next.js Course: bytegrad.com/courses/professional-react-nextjs
This is literally a life saver package .. thanks for sharing ❤
Excited about the complete reusable button component video. When does it lands?
Working on it 😉
a lot of the necessity for thins seems to come from the fact that people often forget to "actually" render just the right classnames when needed.
instead of this:
className={`bg-white px-4 py-2 ${someVar ? 'bg-black' : '' }`}
do this:
className={`px-4 py-2 ${someVar ? 'bg-black' : 'bg-white' }`}
This is very simplified ofc, just illustrating
9:32 dynamic class is not working when restart project(npm run dev). tailwind do not leave class.
/ code sample
className={twMerge(`mobile:${gnbActive ? "flex" : "hidden"}`)}
please check up this.
How does this tailwind add the bg-grey-500? Because you said it uses regex?
I am done with tailwind. I have to use custom components. Well, twMerge do not recognize custom components of tailwind config, so if you want to use twmerge, you have to repeat all your custom classes configuation in twmerge config. And it has bugs, like twmerge("w-96", "w-full") is not working.
W-full will override w-96
@@ByteGrad well I am maybe doing something really wrong because it is not overwriting it. I have the 2 classes and w-full is strikethrough. I saw the git discussions. There was a similar bug with w-fit and w-full. By the way, your content is awesome!
how can i pass a children
Good question, I’ll have a complete reusable button component video soon
@@ByteGrad thanks, i'll be waiting for that
First big mistake is using Tailwind, it always end up with JS inline styles or finally creating and importing a .css file
It's much faster to write using Tailwind's utility classes than inline JS, but also it makes your spacing, sizes, etc much more consistent and easier to work with. Having the styles on the same file as the component also makes it a lot easier to figure out what is going on so you don't have to back and forth between files, so yeah, using Tailwind is definitely NOT a mistake.
noobs when a library offers utility classes 😡😡😡😡