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

The page width be changed when y scrollbar appears cause bad ux #4215

Closed
4 tasks done
wbxl2000 opened this issue Sep 19, 2024 · 3 comments
Closed
4 tasks done

The page width be changed when y scrollbar appears cause bad ux #4215

wbxl2000 opened this issue Sep 19, 2024 · 3 comments
Labels
bug: pending triage Maybe a bug, waiting for confirmation

Comments

@wbxl2000
Copy link

Describe the bug

When the vertical scroll bar appears in some long content pages, the page width changes, which results in a bad user experience.

Maybe add placeholder space for the scrollbar?

2024-09-19.17-40-23.mp4

Reproduction

https://vitepress.dev/reference/default-theme-carbon-ads

compare to

https://vitepress.dev/reference/default-theme-search

Expected behavior

the content width don't be changed, which means the toc's and nav bar's position will not change.

System Info

all

Additional context

No response

Validations

@wbxl2000 wbxl2000 added the bug: pending triage Maybe a bug, waiting for confirmation label Sep 19, 2024
@wbxl2000
Copy link
Author

Here is an article describing this.

@brc-dd
Copy link
Member

brc-dd commented Sep 19, 2024

Duplicate of #1054

@brc-dd brc-dd marked this as a duplicate of #1054 Sep 19, 2024
@brc-dd brc-dd closed this as not planned Won't fix, can't repro, duplicate, stale Sep 19, 2024
@wbxl2000
Copy link
Author

Got it, thanks.

For others encountering this issue, I share my way to "fix" it.

/* .vitepress/theme/custom.css */
html {
	overflow-y: scroll;
}

body::-webkit-scrollbar{
  width:10px;
  height:10px;
}
body::-webkit-scrollbar-track{
  background: #fff;
  border-radius:2px;
}
body::-webkit-scrollbar-thumb{
  background: #bfbfbf;
  border-radius:10px;
}
body::-webkit-scrollbar-thumb:hover{
  background: #333;
}
body::-webkit-scrollbar-corner{
  background: #179a16;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: pending triage Maybe a bug, waiting for confirmation
Projects
None yet
Development

No branches or pull requests

2 participants