forked from Chanzhaoyu/chatgpt-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: 🐛 fix scroll bar style (Chanzhaoyu#617)
- Loading branch information
1 parent
e728640
commit 0dc400b
Showing
3 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import setupAssets from './assets' | ||
import setupScrollbarStyle from './scrollbarStyle' | ||
|
||
export { setupAssets } | ||
export { setupAssets, setupScrollbarStyle } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { darkTheme, lightTheme } from 'naive-ui' | ||
|
||
const setupScrollbarStyle = () => { | ||
const style = document.createElement('style') | ||
const styleContent = ` | ||
::-webkit-scrollbar { | ||
background-color: transparent; | ||
width: ${lightTheme.Scrollbar.common?.scrollbarWidth}; | ||
} | ||
::-webkit-scrollbar-thumb { | ||
background-color: ${lightTheme.Scrollbar.common?.scrollbarColor}; | ||
border-radius: ${lightTheme.Scrollbar.common?.scrollbarBorderRadius}; | ||
} | ||
html.dark ::-webkit-scrollbar { | ||
background-color: transparent; | ||
width: ${darkTheme.Scrollbar.common?.scrollbarWidth}; | ||
} | ||
html.dark ::-webkit-scrollbar-thumb { | ||
background-color: ${darkTheme.Scrollbar.common?.scrollbarColor}; | ||
border-radius: ${darkTheme.Scrollbar.common?.scrollbarBorderRadius}; | ||
} | ||
` | ||
|
||
style.innerHTML = styleContent | ||
document.head.appendChild(style) | ||
} | ||
|
||
export default setupScrollbarStyle |