CSS Infinity Use Cases
خلاصه هوش مصنوعی
CSS اکنون مقدار Infinity را پشتیبانی میکند، اما این مقدار فقط میتواند داخل توابع calc() استفاده شود؛ برای مثال میتوان آن را در border-radius: calc(infinity * 1px); به کار برد. آدم در پست خود چندین کاربرد برای این ویژگی پیشنهاد داده و پیش از این ویلی نیز ایدههای مشابهی را آزمایش کرده بود. بهطور کلی، Infinity در CSS زمانی مفید است که بخواهید یک مقدار بهطور نظری نامحدود را در محاسبات calc() تضمین کنید.
It’s kinda cool there is Infinity in CSS. You just always need to use it within a calc(), like border-radius: calc(infinity * 1px);. Adam has lots of ideas in that post, and I remember Will was messing with similar ideas a few years ago.
I’d say just use it when you’re trying to use an absolutely huge number like 99999 or whatever, as it expresses what you mean more clearly. But it’s not always quite right. I was just watching Kevin’s new favorite trick video where he uses 1e5 as a big value in a clamp() and infinity doesn’t work there, calc() or not.