by OJFord · 9y ago · 0 comments
I'm not even saying don't add the dependency - why should this project be an API instead of some CSS that I load, and then write:
<div class="ui-avatar-com ui-avatar-com-blue">OF</div>
The only thing I can see is the gravatar callback (which incidentally has to use a different endpoint anyway to work-around gravatar not supporting query params) - is that not as niche of a use as it seemed to me?One use case I see is for native mobile apps to generate the avatars as an initial profile image during the signup.
The reason its not CSS is because this api generates the initials for you.
CSS is way faster, so I’d recommend that
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.
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