←back to thread

2093 points pabs3 | 1 comments | | HN request time: 0.486s | source
1. krtab ◴[] No.42140438[source]
Cool use of tech!

> I ended up writing a small JavaScript function to maximize font size: it makes the text invisible (via CSS visibility: hidden), tries displaying the text at a very large size, and then tries successively smaller font sizes until it finds a size that lets all the text fit. It then makes the text visible again.

That would be a good application for dichotomic search if performance was ever a problem (I doubt it though).

More generally, having elements on a grid of different sizes should hopefully be much more easy once CSS masonry grid is available.