Menu

Our social cards pick a type size by counting characters, so 36 of them draw three lines and 38 draw two
📰

Our social cards pick a type size by counting characters, so 36 of them draw three lines and 38 draw two

DEV Community: javascript·Daniel Pertu·6 days ago
#QV96xIqk
#devtojavascript#devto#dev#lines#line
Long article (1499 words) — no AI summary yet.
Reading 0:00
15s threshold

Every public page on Nakodo has a social card drawn at build time by next/og , served from /og/<page path> . I measured all 76 of them a while ago: bytes, dimensions, and the fact that the only expensive thing in a flat-colour PNG is letters. That post measured the files. This one measures what is drawn inside them.

There are 29 more pages now, so first the refresh:

cards 105 (the home page has its own static one) HTTP 200 105 dimensions 1200x630, all of them total bytes 5,437,635 (was 3,989,337 at 76 cards) median 53,156 smallest 36,351 /blog, still largest 60,669 /youtubers/travel, still

Enter fullscreen mode

Exit fullscreen mode

29 new cards and neither end of the range moved, which tells you the new pages write titles the same length as the old ones.

The branch I wanted to look at

The card picks its type size like this:

const size = title . length > 60 ? 54 : title . length > 36 ?…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.