Skip to content

Commit

Permalink
fix auto-sized logo sizes (#10764)
Browse files Browse the repository at this point in the history
  • Loading branch information
LitoMore authored Dec 29, 2024
1 parent e6b66a8 commit 00c73c8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/logos.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,13 @@ function getSimpleIcon({ name, color, style, size }) {
if (size === 'auto') {
const { width: iconWidth, height: iconHeight } = getIconSize(key)

if (iconWidth > iconHeight) {
if (iconWidth !== iconHeight) {
const path = resetIconPosition(simpleIcons[key].path)
iconSvg = iconSvg
.replace('viewBox="0 0 24 24"', `viewBox="0 0 24 ${iconHeight}"`)
.replace(
'viewBox="0 0 24 24"',
`viewBox="0 0 ${iconWidth} ${iconHeight}"`,
)
.replace(/<path d=".*"\/>/, `<path d="${path}"/>`)
}
}
Expand Down

0 comments on commit 00c73c8

Please sign in to comment.