From 471f00a68d1e3d8d925ab996f462adaf4f1261a0 Mon Sep 17 00:00:00 2001 From: Kia King Ishii Date: Tue, 17 Jan 2023 22:05:18 +0900 Subject: [PATCH] feat(theme): refine overall styles (#1049) (#1790) close #1049 --- .../theme-default/components/VPBackdrop.vue | 2 +- .../theme-default/components/VPButton.vue | 2 +- .../theme-default/components/VPCarbonAds.vue | 23 +- src/client/theme-default/components/VPDoc.vue | 6 +- .../components/VPDocAsideOutline.vue | 2 +- .../theme-default/components/VPDocFooter.vue | 8 +- .../theme-default/components/VPFeature.vue | 17 +- .../theme-default/components/VPFlyout.vue | 24 +- .../theme-default/components/VPFooter.vue | 2 +- .../components/VPHomeSponsors.vue | 2 +- .../theme-default/components/VPLocalNav.vue | 6 +- .../theme-default/components/VPMenu.vue | 20 +- .../theme-default/components/VPMenuGroup.vue | 4 +- .../theme-default/components/VPMenuLink.vue | 8 +- src/client/theme-default/components/VPNav.vue | 37 +- .../theme-default/components/VPNavBar.vue | 118 ++++-- .../components/VPNavBarMenuLink.vue | 8 +- .../components/VPNavBarSearch.vue | 4 +- .../components/VPNavBarTitle.vue | 19 +- .../theme-default/components/VPNavScreen.vue | 4 +- .../components/VPNavScreenAppearance.vue | 2 - .../components/VPNavScreenMenuGroup.vue | 2 +- .../components/VPNavScreenMenuGroupLink.vue | 4 +- .../components/VPNavScreenMenuLink.vue | 4 +- .../theme-default/components/VPSidebar.vue | 8 +- .../theme-default/components/VPSwitch.vue | 12 +- .../components/VPTeamMembersItem.vue | 6 +- .../components/VPTeamPageSection.vue | 2 +- .../styles/components/custom-block.css | 2 +- .../styles/components/vp-doc.css | 20 +- .../styles/components/vp-sponsor.css | 6 +- src/client/theme-default/styles/vars.css | 369 ++++++++---------- 32 files changed, 358 insertions(+), 395 deletions(-) diff --git a/src/client/theme-default/components/VPBackdrop.vue b/src/client/theme-default/components/VPBackdrop.vue index 1f72a8583cdd..4516996bdd40 100644 --- a/src/client/theme-default/components/VPBackdrop.vue +++ b/src/client/theme-default/components/VPBackdrop.vue @@ -18,7 +18,7 @@ defineProps<{ bottom: 0; left: 0; z-index: var(--vp-z-index-backdrop); - background: var(--vp-c-bg-backdrop); + background: var(--vp-backdrop-bg-color); transition: opacity 0.5s; } diff --git a/src/client/theme-default/components/VPButton.vue b/src/client/theme-default/components/VPButton.vue index 4a1750ccb949..57872a8b15e3 100644 --- a/src/client/theme-default/components/VPButton.vue +++ b/src/client/theme-default/components/VPButton.vue @@ -45,7 +45,7 @@ const component = computed(() => { display: inline-block; border: 1px solid transparent; text-align: center; - font-weight: 500; + font-weight: 600; white-space: nowrap; transition: color 0.25s, border-color 0.25s, background-color 0.25s; } diff --git a/src/client/theme-default/components/VPCarbonAds.vue b/src/client/theme-default/components/VPCarbonAds.vue index b82b9e7fce06..8b0805e83755 100644 --- a/src/client/theme-default/components/VPCarbonAds.vue +++ b/src/client/theme-default/components/VPCarbonAds.vue @@ -47,7 +47,7 @@ if (carbonOptions) {
- diff --git a/src/client/theme-default/components/VPDoc.vue b/src/client/theme-default/components/VPDoc.vue index 89d189127266..bcec9e6a81e3 100644 --- a/src/client/theme-default/components/VPDoc.vue +++ b/src/client/theme-default/components/VPDoc.vue @@ -120,8 +120,8 @@ provide('onContentUpdated', onContentUpdated) .aside-container { position: sticky; top: 0; - margin-top: calc((var(--vp-nav-height-desktop) + var(--vp-layout-top-height, 0px)) * -1 - 32px); - padding-top: calc(var(--vp-nav-height-desktop) + var(--vp-layout-top-height, 0px) + 32px); + margin-top: calc((var(--vp-nav-height) + var(--vp-layout-top-height, 0px)) * -1 - 32px); + padding-top: calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 32px); height: 100vh; overflow-x: hidden; overflow-y: auto; @@ -144,7 +144,7 @@ provide('onContentUpdated', onContentUpdated) .aside-content { display: flex; flex-direction: column; - min-height: calc(100vh - (var(--vp-nav-height-desktop) + var(--vp-layout-top-height, 0px) + 32px)); + min-height: calc(100vh - (var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 32px)); padding-bottom: 32px; } diff --git a/src/client/theme-default/components/VPDocAsideOutline.vue b/src/client/theme-default/components/VPDocAsideOutline.vue index c8160cca43d7..430c73bfc0ed 100644 --- a/src/client/theme-default/components/VPDocAsideOutline.vue +++ b/src/client/theme-default/components/VPDocAsideOutline.vue @@ -67,7 +67,7 @@ function handleClick({ target: el }: Event) { .content { position: relative; - border-left: 1px solid var(--vp-c-divider-light); + border-left: 1px solid var(--vp-c-divider); padding-left: 16px; font-size: 13px; font-weight: 500; diff --git a/src/client/theme-default/components/VPDocFooter.vue b/src/client/theme-default/components/VPDocFooter.vue index 848ab1439007..d441a171ff56 100644 --- a/src/client/theme-default/components/VPDocFooter.vue +++ b/src/client/theme-default/components/VPDocFooter.vue @@ -97,7 +97,7 @@ const showFooter = computed(() => { } .prev-next { - border-top: 1px solid var(--vp-c-divider-light); + border-top: 1px solid var(--vp-c-divider); padding-top: 24px; } @@ -127,7 +127,7 @@ const showFooter = computed(() => { .pager-link { display: block; - border: 1px solid var(--vp-c-divider-light); + border: 1px solid var(--vp-c-divider); border-radius: 8px; padding: 11px 16px 13px; width: 100%; @@ -139,10 +139,6 @@ const showFooter = computed(() => { border-color: var(--vp-c-brand); } -.pager-link:hover .title { - color: var(--vp-c-brand-dark); -} - .pager-link.next { margin-left: auto; text-align: right; diff --git a/src/client/theme-default/components/VPFeature.vue b/src/client/theme-default/components/VPFeature.vue index 39ef5e90b5a7..41e9c7199231 100644 --- a/src/client/theme-default/components/VPFeature.vue +++ b/src/client/theme-default/components/VPFeature.vue @@ -48,11 +48,7 @@ defineProps<{ .VPFeature.link:hover { border-color: var(--vp-c-brand); - background-color: var(--vp-c-bg); -} - -.dark .VPFeature.link:hover { - background-color: var(--vp-c-bg-mute); + background-color: var(--vp-c-bg-soft-up); } .box { @@ -73,17 +69,13 @@ defineProps<{ align-items: center; margin-bottom: 20px; border-radius: 6px; - background-color: var(--vp-c-gray-light-4); + background-color: var(--vp-c-bg-soft-down); width: 48px; height: 48px; font-size: 24px; transition: background-color 0.25s; } -.dark .icon { - background-color: var(--vp-c-gray-dark-5); -} - .title { line-height: 24px; font-size: 16px; @@ -109,11 +101,6 @@ defineProps<{ font-size: 14px; font-weight: 500; color: var(--vp-c-brand); - transition: color 0.25s; -} - -.VPFeature.link:hover .link-text-value { - color: var(--vp-c-brand-dark); } .link-text-icon { diff --git a/src/client/theme-default/components/VPFlyout.vue b/src/client/theme-default/components/VPFlyout.vue index cf36c8f26990..b13256897192 100644 --- a/src/client/theme-default/components/VPFlyout.vue +++ b/src/client/theme-default/components/VPFlyout.vue @@ -91,33 +91,21 @@ function onBlur() { display: flex; align-items: center; padding: 0 12px; - height: var(--vp-nav-height-mobile); + height: var(--vp-nav-height); color: var(--vp-c-text-1); transition: color 0.5s; } -@media (min-width: 960px) { - .button { - height: var(--vp-nav-height-desktop); - } -} - .text { display: flex; align-items: center; - line-height: var(--vp-nav-height-mobile); + line-height: var(--vp-nav-height); font-size: 14px; font-weight: 500; color: var(--vp-c-text-1); transition: color 0.25s; } -@media (min-width: 960px) { - .text { - line-height: var(--vp-nav-height-desktop); - } -} - .option-icon { margin-right: 0px; width: 16px; @@ -141,16 +129,10 @@ function onBlur() { .menu { position: absolute; - top: calc(var(--vp-nav-height-mobile) / 2 + 20px); + top: calc(var(--vp-nav-height) / 2 + 20px); right: 0; opacity: 0; visibility: hidden; transition: opacity 0.25s, visibility 0.25s, transform 0.25s; } - -@media (min-width: 960px) { - .menu { - top: calc(var(--vp-nav-height-desktop) / 2 + 20px); - } -} diff --git a/src/client/theme-default/components/VPFooter.vue b/src/client/theme-default/components/VPFooter.vue index 381b82e89c35..4e831ce5c2a4 100644 --- a/src/client/theme-default/components/VPFooter.vue +++ b/src/client/theme-default/components/VPFooter.vue @@ -19,7 +19,7 @@ const { hasSidebar } = useSidebar() .VPFooter { position: relative; z-index: var(--vp-z-index-footer); - border-top: 1px solid var(--vp-c-divider-light); + border-top: 1px solid var(--vp-c-gutter); padding: 32px 24px; background-color: var(--vp-c-bg); } diff --git a/src/client/theme-default/components/VPHomeSponsors.vue b/src/client/theme-default/components/VPHomeSponsors.vue index 88249522d283..72eefca81442 100644 --- a/src/client/theme-default/components/VPHomeSponsors.vue +++ b/src/client/theme-default/components/VPHomeSponsors.vue @@ -48,7 +48,7 @@ defineProps<{ diff --git a/src/client/theme-default/components/VPNavBar.vue b/src/client/theme-default/components/VPNavBar.vue index 176d4490bc02..bf8c653fdc58 100644 --- a/src/client/theme-default/components/VPNavBar.vue +++ b/src/client/theme-default/components/VPNavBar.vue @@ -23,12 +23,15 @@ const { hasSidebar } = useSidebar() diff --git a/src/client/theme-default/components/VPNavScreenMenuGroup.vue b/src/client/theme-default/components/VPNavScreenMenuGroup.vue index d66e02c9aca3..25f70c76f43a 100644 --- a/src/client/theme-default/components/VPNavScreenMenuGroup.vue +++ b/src/client/theme-default/components/VPNavScreenMenuGroup.vue @@ -54,7 +54,7 @@ function toggle() {