mirror of
https://github.com/badges/shields.git
synced 2025-04-18 19:44:04 +03:00
fix auto-sized logo sizes (#10764)
This commit is contained in:
parent
e6b66a8865
commit
00c73c872d
@ -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}"/>`)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user