Andreu Botella
andreubotella.com
Andreu Botella
@andreubotella.com
Browser engineer at @igalia.com. I work on things ranging from CSS and layout in browsers, to Javascript language features, to interoperability between browsers and server-side runtimes as a co-chair of WinterTC. They/them
The behavior I would have expected would be something like this: 0% means 1 line, 100% means the full number of lines, and everything is evenly spaced.

So clamping by `floor(1 + (percentage / 100) * (numLines - 1))`.
August 27, 2025 at 2:39 PM
This is the smallest values that trigger clamping by that many lines, on a test with 5 lines. From what I can tell, it behaves like clamping by `max(1, floor((percentage / 100) * (numLines + 1)))` lines.

The `numLines + 1` multiplier means you can clamp by the full number of lines (5 here) with 84%
August 27, 2025 at 2:39 PM
I'm pumped about the enum JS proposal, (that makes enums part of core JS, not just TS) -- not so much because of the proposal itself, but because one of the possible future directions for it would finally let JS evolve to crab. 🦀
May 6, 2025 at 9:14 AM