-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Add auto-size support for Simple Icons logos #8372
Copy link
Copy link
Closed
Description
📋 Description
The logo feature only renders in the viewBox="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:
import svgPathBbox from 'svg-path-bbox'
const [x0, y0, x1, y1] = svgPathBbox(icon.path)
const width = x1 - x0
const height = y1 - y0
// We may need to deal with `width > height` for badges
if (width > height) {
// Resize the logo part
}We could handle the resizing logic in load-simple-icons.js or other places.
Other logoWidth and logoHeight related logics may also need to be updated.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels