This repository was archived by the owner on Feb 10, 2025. It is now read-only.
File tree 3 files changed +33
-2
lines changed
3 files changed +33
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { createApp } from 'vue'
2
2
import App from './App.vue'
3
3
import { setupI18n } from './locales'
4
- import { setupAssets } from './plugins'
4
+ import { setupAssets , setupScrollbarStyle } from './plugins'
5
5
import { setupStore } from './store'
6
6
import { setupRouter } from './router'
7
7
8
8
async function bootstrap ( ) {
9
9
const app = createApp ( App )
10
10
setupAssets ( )
11
11
12
+ setupScrollbarStyle ( )
13
+
12
14
setupStore ( app )
13
15
14
16
setupI18n ( app )
Original file line number Diff line number Diff line change 1
1
import setupAssets from './assets'
2
+ import setupScrollbarStyle from './scrollbarStyle'
2
3
3
- export { setupAssets }
4
+ export { setupAssets , setupScrollbarStyle }
Original file line number Diff line number Diff line change
1
+ import { darkTheme , lightTheme } from 'naive-ui'
2
+
3
+ const setupScrollbarStyle = ( ) => {
4
+ const style = document . createElement ( 'style' )
5
+ const styleContent = `
6
+ ::-webkit-scrollbar {
7
+ background-color: transparent;
8
+ width: ${ lightTheme . Scrollbar . common ?. scrollbarWidth } ;
9
+ }
10
+ ::-webkit-scrollbar-thumb {
11
+ background-color: ${ lightTheme . Scrollbar . common ?. scrollbarColor } ;
12
+ border-radius: ${ lightTheme . Scrollbar . common ?. scrollbarBorderRadius } ;
13
+ }
14
+ html.dark ::-webkit-scrollbar {
15
+ background-color: transparent;
16
+ width: ${ darkTheme . Scrollbar . common ?. scrollbarWidth } ;
17
+ }
18
+ html.dark ::-webkit-scrollbar-thumb {
19
+ background-color: ${ darkTheme . Scrollbar . common ?. scrollbarColor } ;
20
+ border-radius: ${ darkTheme . Scrollbar . common ?. scrollbarBorderRadius } ;
21
+ }
22
+ `
23
+
24
+ style . innerHTML = styleContent
25
+ document . head . appendChild ( style )
26
+ }
27
+
28
+ export default setupScrollbarStyle
You can’t perform that action at this time.
0 commit comments