feat(style): add scrollbar for docs (#4800)

* feat(style): add scrollbar for docs

* fix(style): adjust scrollbar color
This commit is contained in:
云游君 2021-12-13 00:07:28 +08:00 committed by GitHub
parent 324edcda96
commit 7caa13e80c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 30 additions and 4 deletions

View File

@ -71,7 +71,7 @@ const onNavClick = (item: Link) => {
vertical-align: unset;
}
.badge::v-deep .is-dot {
.badge:deep(.is-dot) {
right: 0;
}
}

View File

@ -2,6 +2,7 @@
@use './base';
@use './code';
@use './navbar';
@use './scrollbar';
@use './subnav';
@use './overlay';
@use './sidebar';

View File

@ -0,0 +1,25 @@
// scrollbar
* {
scrollbar-color: var(--el-scrollbar-bg-color) var(--el-bg-color);
}
::-webkit-scrollbar {
width: 6px;
}
::-webkit-scrollbar:horizontal {
height: 6px;
}
::-webkit-scrollbar-track {
border-radius: 10px;
}
::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.2);
border-radius: 10px;
transition: all 0.2s ease-in-out;
&:hover {
cursor: pointer;
background-color: rgba(0, 0, 0, 0.3);
}
}

View File

@ -96,9 +96,9 @@ scrollbar/manual-scroll
## Scrollbar Events
| Event Name | Description | Parameters |
| ---------- | ----------------------- | ----------------------------------------------- |
| scroll | triggers when scrolling | distance of scrolling { scrollLeft, scrollTop } |
| Event Name | Description | Parameters |
| ---------- | ----------------------- | ------------------------------------------------- |
| scroll | triggers when scrolling | distance of scrolling `{ scrollLeft, scrollTop }` |
## Scrollbar Methods