From 00c73c872d9baa5b3e22c658b8d8b73b8b311f7d Mon Sep 17 00:00:00 2001 From: LitoMore Date: Mon, 30 Dec 2024 01:04:24 +0800 Subject: [PATCH] fix auto-sized logo sizes (#10764) --- lib/logos.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/logos.js b/lib/logos.js index 813b4cf3675ff..fbf3f76eeb9ca 100644 --- a/lib/logos.js +++ b/lib/logos.js @@ -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(//, ``) } }