Hacker News new | ask | show | jobs
by lasserafn 3174 days ago
It’s made to be a gravatar fallback :)

The reason its not CSS is because this api generates the initials for you.

CSS is way faster, so I’d recommend that

1 comments

> The reason its not CSS is because this api generates the initials for you.

It's been a while since I've written any CSS, but I'm pretty sure you can select first letters? Useful for drop caps, for example.

Absolutely, but it’s not that simpel, it’s made to be flexible and handle different logic. Not that it’s magic by any means, it’s fairly simple but you’d want to generate the initials on the server anyway, to acomplish similar results

For example, it takes first letter of first name, and 2 letters from last name if only two names supplied and desired length is 3.

However if 3 names are supplied, it uses a letter from each name.

It’s not magic, but doing it in CSS wouldn’t be easy, I imagine