Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(components):Local navigation location error #4393

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

yuxi-ovo
Copy link

fixes #4359

@yuxi-ovo
Copy link
Author

yuxi-ovo commented Dec 1, 2024

who can help me

@yuxi-ovo
Copy link
Author

yuxi-ovo commented Dec 4, 2024

@brc-dd

@yuxi-ovo
Copy link
Author

yuxi-ovo commented Jan 5, 2025

111

@yuyinws
Copy link
Contributor

yuyinws commented Jan 14, 2025

I think we should add the has-sidebar class to the top element, then get the left value by CSS selectors.

Example:

.VPContent.has-sidebar {
margin: var(--vp-layout-top-height, 0px) 0 0;
padding-left: var(--vp-sidebar-width);
}

@yuxi-ovo
Copy link
Author

@yuyinws ok Thank you for your help. Is that right for me?

@yuyinws
Copy link
Contributor

yuyinws commented Jan 17, 2025

Please fix the CI error.

@yuxi-ovo
Copy link
Author

ok

@yuxi-ovo
Copy link
Author

hello

@yuyinws
Copy link
Contributor

yuyinws commented Feb 12, 2025

Please fix the code review.

@yuxi-ovo
Copy link
Author

where

@@ -16,6 +17,7 @@ const open = ref(false)
const vh = ref(0)
const main = ref<HTMLDivElement>()
const items = ref<HTMLDivElement>()
const {hasSidebar} = useSidebar()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add blank space.

Suggested change
const { hasSidebar } = useSidebar()

@@ -165,6 +170,9 @@ function scrollToTop() {
left: calc(var(--vp-sidebar-width) + 32px);
width: 320px;
}
.VPLocalNavOutlineDropdown:not(.has-sidebar) .items{
left:32px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add blank space.

Suggested change
left:32px;
.VPLocalNavOutlineDropdown:not(.has-sidebar) .items {

@yuyinws
Copy link
Contributor

yuyinws commented Feb 13, 2025

Sorry my mistake, you can see it now.

@yuxi-ovo
Copy link
Author

is that so?

@yuxi-ovo yuxi-ovo requested a review from yuyinws February 13, 2025 08:23
@yuyinws
Copy link
Contributor

yuyinws commented Feb 14, 2025

image

@yuxi-ovo
Copy link
Author

OK!

@yuyinws
Copy link
Contributor

yuyinws commented Feb 14, 2025

LGTM
/cc @brc-dd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Local navigation dropdown misplaced without sidebar
2 participants