fix(theme): fix fontawesome icon, close #720 (#721)

This commit is contained in:
pengzhanbo 2025-10-13 13:50:52 +08:00 committed by GitHub
parent c476c2059b
commit 89cb6a585a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -11,7 +11,7 @@ interface AssetInfo {
} }
function getFontAwesomeCDNLink(type: string): string { function getFontAwesomeCDNLink(type: string): string {
return `https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6/js/${type}.min.js` return `https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/js/${type}.min.js`
} }
export function prepareIcon( export function prepareIcon(
@ -38,7 +38,7 @@ export function prepareIcon(
if (asset === 'fontawesome-with-brands') { if (asset === 'fontawesome-with-brands') {
return normalizeAsset(getFontAwesomeCDNLink('brands'), 'fontawesome') return normalizeAsset(getFontAwesomeCDNLink('brands'), 'fontawesome')
} }
return null return normalizeAsset(asset, 'fontawesome')
}).flat().filter(notNullish)) }).flat().filter(notNullish))
} }
let hasStyle = false let hasStyle = false

View File

@ -56,6 +56,8 @@ const extraClasses = computed(() => {
<style> <style>
.vp-icon.fontawesome { .vp-icon.fontawesome {
display: inline-block; display: inline-block;
width: initial;
height: initial;
line-height: inherit; line-height: inherit;
vertical-align: middle; vertical-align: middle;
} }