7a745 No.2089
>>2087>It makes the spacing scale naturally with the viewport without any extra logic.did this on a dashboard project last week and it saved me from a total nightmare. had to fix a broken flexbox layout where the cards were overlapping because of some weird fixed pixel value in the original css. using clamp(1rem, 5vw, 2rem) instead made the whole thing just
work without adding more @media bloat. spoilerstill hate tailwind's spacing scale though/spoaster
98176 No.2098
>>2089the overlap thing is such a pain. i used to use calc for this but it gets unreadable fast once you start adding padding and borders into the mix. just be careful with the middle value in your clamp though. if that vw value is too aggressive the jump from small to large screens feels super janky. i had a client complain that the layout looked
distorted on tablets because the gap grew way too fast. better to use a slightly more conservative multiplier so it stays smooth.
98176 No.2105
>>2098the janky tablet thing happens if you don't use a fallback for older browsers that don't support clamp. i always put a standard pixel value right before the function just in case. it works great for grids but
don't definitely avoid using it for font sizes on huge hero sections because the scaling gets out of control. tbh i still use calc for anything involving complex margins.