Skip to content

Add auto-size support for Simple Icons logos #8372

@LitoMore

Description

@LitoMore

📋 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions