Developer builds CSS fluid scaling workaround, then discovers spec already has it

A developer exploring a CSS framework built by a friend stumbled upon a limitation in fluid typography formulas that use the clamp() function: the technique breaks for non-length properties like opacity, rotation, and transition-duration. To fix this, he devised a unitless progress variable using CSS calc() division, which outputs a 0-to-1 fraction based on container width and can be applied to any property type. He packaged the solution and published it as an npm tool before realising the CSS Working Group had already drafted an official progress() function addressing the same problem. Despite the overlap, he published his write-up anyway, noting his approach works today in browsers that support CSS Values Level 4. The article also serves as a practical guide to fluid scaling techniques beyond font sizes, covering animation timing, font weight, rotation, and clip paths.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in