chore: dark config

This commit is contained in:
jialin
2025-04-28 10:05:06 +08:00
parent d4d7148f16
commit ce9c31f368
35 changed files with 678 additions and 399 deletions
+7 -1
View File
@@ -1,3 +1,5 @@
import { userSettingsHelperAtom } from '@/atoms/settings';
import { useAtom } from 'jotai';
import { throttle } from 'lodash';
import {
UseOverlayScrollbarsParams,
@@ -28,6 +30,7 @@ export default function useOverlayScroller(data?: {
events?: any;
defer?: boolean;
}) {
const [useSettings] = useAtom(userSettingsHelperAtom);
const { options, events, defer = true } = data || {};
const scrollEventElement = React.useRef<any>(null);
const instanceRef = React.useRef<any>(null);
@@ -44,7 +47,10 @@ export default function useOverlayScroller(data?: {
x: 'hidden'
},
scrollbars: {
theme: options?.theme || 'os-theme-dark',
theme:
options?.theme || useSettings.theme === 'light'
? 'os-theme-dark'
: 'os-theme-light',
autoHide: 'scroll',
autoHideDelay: 600,
clickScroll: 'instant'