From 636cca042dfbca006af2d702ddec0a2ff601cb46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20S=C3=A1nchez?= Date: Sat, 17 Feb 2024 14:34:16 +0100 Subject: [PATCH] perf(theme): move svg icons to css (#3537) Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> --- package.json | 2 +- .../theme-default/components/VPDocFooter.vue | 6 +- .../theme-default/components/VPFeature.vue | 7 +- .../theme-default/components/VPFlyout.vue | 22 +--- .../components/VPHomeSponsors.vue | 13 +- .../theme-default/components/VPLocalNav.vue | 7 +- .../components/VPLocalNavOutlineDropdown.vue | 23 ++-- .../components/VPLocalSearchBox.vue | 123 +++--------------- .../components/VPNavBarSearchButton.vue | 21 +-- .../components/VPNavBarTranslations.vue | 3 +- .../components/VPNavScreenMenuGroup.vue | 8 +- .../components/VPNavScreenTranslations.vue | 10 +- .../components/VPSidebarItem.vue | 7 +- .../theme-default/components/VPSocialLink.vue | 9 +- .../theme-default/components/VPSwitch.vue | 8 +- .../components/VPSwitchAppearance.vue | 6 +- .../components/VPTeamMembersItem.vue | 7 +- src/client/theme-default/styles/icons.css | 123 ++++++++++++++++++ src/client/theme-default/styles/vars.css | 9 -- .../theme-default/support/socialIcons.ts | 23 ---- src/client/theme-default/without-fonts.ts | 1 + theme.d.ts | 25 ++-- 22 files changed, 210 insertions(+), 253 deletions(-) create mode 100644 src/client/theme-default/styles/icons.css delete mode 100644 src/client/theme-default/support/socialIcons.ts diff --git a/package.json b/package.json index f7f161976461..ce010ab2719d 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "1.0.0-rc.42", "description": "Vite & Vue powered static site generator", "type": "module", - "packageManager": "pnpm@8.15.1", + "packageManager": "pnpm@8.15.3", "main": "dist/node/index.js", "types": "types/index.d.ts", "exports": { diff --git a/src/client/theme-default/components/VPDocFooter.vue b/src/client/theme-default/components/VPDocFooter.vue index 6de55347e04a..53f199ea8892 100644 --- a/src/client/theme-default/components/VPDocFooter.vue +++ b/src/client/theme-default/components/VPDocFooter.vue @@ -3,7 +3,6 @@ import { computed } from 'vue' import { useData } from '../composables/data' import { useEditLink } from '../composables/edit-link' import { usePrevNext } from '../composables/prev-next' -import VPIconEdit from './icons/VPIconEdit.vue' import VPLink from './VPLink.vue' import VPDocFooterLastUpdated from './VPDocFooterLastUpdated.vue' @@ -30,7 +29,7 @@ const showFooter = computed(() => {
@@ -92,9 +91,6 @@ const showFooter = computed(() => { .edit-link-icon { margin-right: 8px; - width: 14px; - height: 14px; - fill: currentColor; } .prev-next { diff --git a/src/client/theme-default/components/VPFeature.vue b/src/client/theme-default/components/VPFeature.vue index abdade78b0c3..e6e058802e5c 100644 --- a/src/client/theme-default/components/VPFeature.vue +++ b/src/client/theme-default/components/VPFeature.vue @@ -2,7 +2,6 @@ import type { DefaultTheme } from 'vitepress/theme' import VPImage from './VPImage.vue' import VPLink from './VPLink.vue' -import VPIconArrowRight from './icons/VPIconArrowRight.vue' defineProps<{ icon?: DefaultTheme.FeatureIcon @@ -46,7 +45,7 @@ defineProps<{ @@ -119,10 +118,6 @@ defineProps<{ } .link-text-icon { - display: inline-block; margin-left: 6px; - width: 14px; - height: 14px; - fill: currentColor; } diff --git a/src/client/theme-default/components/VPFlyout.vue b/src/client/theme-default/components/VPFlyout.vue index 57118fe77821..f4c8f2056ac6 100644 --- a/src/client/theme-default/components/VPFlyout.vue +++ b/src/client/theme-default/components/VPFlyout.vue @@ -1,12 +1,10 @@ @@ -23,8 +22,7 @@ const svg = computed(() => { target="_blank" rel="noopener" v-html="svg" - > - + > diff --git a/src/client/theme-default/components/VPSwitchAppearance.vue b/src/client/theme-default/components/VPSwitchAppearance.vue index f63d1ce4528e..7b13355f0872 100644 --- a/src/client/theme-default/components/VPSwitchAppearance.vue +++ b/src/client/theme-default/components/VPSwitchAppearance.vue @@ -2,8 +2,6 @@ import { inject, computed } from 'vue' import { useData } from '../composables/data' import VPSwitch from './VPSwitch.vue' -import VPIconMoon from './icons/VPIconMoon.vue' -import VPIconSun from './icons/VPIconSun.vue' const { isDark, theme } = useData() @@ -25,8 +23,8 @@ const switchTitle = computed(() => { :aria-checked="isDark" @click="toggleAppearance" > - - + + diff --git a/src/client/theme-default/components/VPTeamMembersItem.vue b/src/client/theme-default/components/VPTeamMembersItem.vue index 5acb21e8f246..f84bdc030999 100644 --- a/src/client/theme-default/components/VPTeamMembersItem.vue +++ b/src/client/theme-default/components/VPTeamMembersItem.vue @@ -1,6 +1,5 @@