-
Notifications
You must be signed in to change notification settings - Fork 7
fix(drawer): 自定义抽屉滚动条样式并阻止滚动穿透至外部页面 #8
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -357,6 +357,26 @@ body.ld-drawer-page-open #ld-drawer-root { | |
| flex: 1; | ||
| min-height: 0; | ||
| overflow: auto; | ||
| overscroll-behavior: contain; | ||
| scrollbar-width: thin; | ||
| scrollbar-color: color-mix(in srgb, var(--tertiary, #3b82f6) 40%, transparent) transparent; | ||
| } | ||
|
|
||
| #ld-drawer-root .ld-drawer-body::-webkit-scrollbar { | ||
| width: 6px; | ||
| } | ||
|
|
||
| #ld-drawer-root .ld-drawer-body::-webkit-scrollbar-track { | ||
| background: transparent; | ||
| } | ||
|
|
||
| #ld-drawer-root .ld-drawer-body::-webkit-scrollbar-thumb { | ||
| background: color-mix(in srgb, var(--tertiary, #3b82f6) 40%, transparent); | ||
| border-radius: 999px; | ||
| } | ||
|
|
||
| #ld-drawer-root .ld-drawer-body::-webkit-scrollbar-thumb:hover { | ||
| background: color-mix(in srgb, var(--tertiary, #3b82f6) 64%, transparent); | ||
|
Comment on lines
+365
to
+379
|
||
| } | ||
|
|
||
| #ld-drawer-root .ld-drawer-content { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overscroll-behavioris not inherited. Since there are other scrollable containers inside the drawer (e.g..ld-drawer-settings-cardalso hasoverflow: auto), scroll chaining can still propagate to the outer page when the user wheels/touches at the top/bottom of those inner scrollers. Consider applyingoverscroll-behavior: contain(oroverscroll-behavior-y) to each scrollable drawer container, or set it on a higher-level wrapper that actually scrolls in all modes.