Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What's the actual use case for "infinity" in CSS?


According to the spec:

These constants are defined mostly to make serialization of infinite/NaN values simpler and more obvious, but can be used to indicate a "largest possible value", since an infinite value gets clamped to the allowed range. It’s rare for this to be reasonable, but when it is, using infinity is clearer in its intent than just putting an enormous number in one’s stylesheet.


Final boss of z-index


What about `infinity + 1`? ;)


TeX has three levels of infinities (fil, fill and filll).


That’s the z-index of your nose.


z-index = i_love_you;


pow(infinity, infinity) is aliased to no_i_love_you_more in CSS5


Isn't the final boss of z-index the top layer?


w buffer cheatcode unlocked.


Cantor has entered the chat.


We use it in Tailwind CSS v4 for pill-shaped borders:

  .rounded-full {
    border-radius: calc(1px * infinity);
  }
...as opposed to what everyone has done historically, which is pick some arbitrary huge value like:

  .rounded-full {
    border-radius: 9999px;
  }
No real practical benefit, just satisfyingly more "correct".


Normally 50% is used as each corner is a quarter of the box. Any reason for not simply using that?


Selling pixels at a dollar each to make an Infinity Dollar Website™.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: