https://codepen.io/kizu/pen/qEddYOO

code {
--captured-length: 100cqi;
--captured-length2: 20ch;
--ratio: tan(atan2(
var(--captured-length),
var(--captured-length2)
));
tab-size: round(up, var(--ratio), 2);
}

tab-size

...

@kizu Oooh. that's fantastic.