Skip to content

Commit

Permalink
feat: scrollbar style
Browse files Browse the repository at this point in the history
  • Loading branch information
zuofenghua committed Jul 29, 2021
1 parent 294c003 commit 34b15ab
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
3 changes: 0 additions & 3 deletions .github/FUNDING.yml

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vitepress-for-component",
"version": "0.14.8",
"version": "0.15.1",
"description": "dumi like documentation tool",
"main": "dist/node/index.js",
"typings": "types/index.d.ts",
Expand Down
3 changes: 2 additions & 1 deletion src/client/theme-default/components/Page.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<main class="page">
<div class="container">
<div class="container hover-scrollbar">
<slot name="top" />

<div class="content">
Expand Down Expand Up @@ -44,6 +44,7 @@ import NextAndPrevLinks from './NextAndPrevLinks.vue'
padding: 0.025rem 2.5rem 2rem;
/* max-width: 50rem; */
width: calc(100% - var(--slug-width));
height: 100%;
}
@media (max-width: 900px) {
Expand Down
2 changes: 1 addition & 1 deletion src/client/theme-default/components/SideBar.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<aside class="sidebar" :class="{ open }">
<aside class="sidebar hover-scrollbar" :class="{ open }">
<NavLinks class="nav" />

<slot name="sidebar-top" />
Expand Down
15 changes: 13 additions & 2 deletions src/client/theme-default/styles/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ form {
max-height: calc(100% - var(--header-height) - 10rem);
width: var(--slug-width);
padding: 50px 24px 0 0;
border-right: 1px solid var(--border-color);
background-color: #fff;
z-index: 3;
overflow-y: auto;
Expand Down Expand Up @@ -249,14 +248,26 @@ form {
height: 100vh;
}

.hover-scrollbar {
overflow-y: hidden !important;
}

.hover-scrollbar:hover {
overflow-y: auto !important;
}

::-webkit-scrollbar {
width: 6px;
height: 10px;
}

::-webkit-scrollbar-thumb {
background-color: #d3d7dd;
background-color: rgba(144, 147, 153, 0.3);
border-radius: 5px;
transition: all 1s;
opacity: 0;
}

::-webkit-scrollbar-track {
background-color: transparent;
}

0 comments on commit 34b15ab

Please sign in to comment.