Why there is not much percentage unit in tailwind like for example I wanted a width of 50%. I understand that I can add custom config to it but I just wanted to know is there any specific reason to it.
Why there is not much percentage unit in tailwind like for example I wanted a width of 50%. I understand that I can add custom config to it but I just wanted to know is there any specific reason to it.
I would say this is more of a personal preference style of coding. After using Tailwind, I realised that most of my styling can be easily and flexibly done by using flex and grid.
Taking your example of width: 50%
// using flex
<div class="flex">
<div class="flex-1">1</div> // 50%
<div class="flex-1">2</div> // 50%
</div>
// using grid
<div class="grid grid-cols-2">
<div>1</div> // 50%
<div>2</div> // 50%
</div>
As you suggested, one can simply add a custom width to the tailwind config as well.