-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add auto-size support for Simple Icons logos #8372
Comments
Just to summarise: At the moment, the logo portion of the badge is a fixed width. Your suggestion is that the logo portion of the badge becomes variable width - is that right? |
Yes. |
Got it. So I guess the tradeoff we have now is there is some subset of "wide but short" logos that render unhelpfully small, whereas one of the nice things about the way we do things right now is that logos which don't take up 100% of the viewport vertically but look perfectly fine are all the same width. e.g: These 3 logos all have slightly different non-blank vertical height, but they all render the same width: Going to a variable horizontal width for logos would make all of those different widths. Then thinking about the most annoying edge case I can generate in the other direction: Imagine a "logo" which is a 1 pixel wide horizontal line. That would cause us to render a really really wide badge :) Obviously that's a deliberately adversarial input, but worth thinking about. I'm on the fence about this - it might be good to mock up some example images to help decide. Maybe if we accepted a PR for this it would make sense to set some kind of upper and lower bound on this. For example:
Between those thresholds, the width can vary to try and better accommodate "wide but short" logos within reasonable parameters. I also wonder if this would make sense to apply only to SimpleIcons only, or also to custom user-supplied logos.. |
Or just let users choose when to resize. We could provide a new parameter like The
Should apply to Simple Icons and customs logos, IMO. |
I will post more examples of different size icons later. |
📋 Description
The
logo
feature only renders in theviewBox="0 0 24 24"
. For some logos, we may not get a nice view. For example:We could calculate the aspect ratio of the icon by using svg-path-bbox:
We could handle the resizing logic in
load-simple-icons.js
or other places.Other
logoWidth
andlogoHeight
related logics may also need to be updated.The text was updated successfully, but these errors were encountered: