File tree Expand file tree Collapse file tree 4 files changed +38
-15
lines changed
shadcn-ui/src/components/scrollbar
effects/layouts/src/widgets/preferences Expand file tree Collapse file tree 4 files changed +38
-15
lines changed Original file line number Diff line number Diff line change @@ -118,9 +118,10 @@ const hiddenSideStyle = computed((): CSSProperties => {
118118});
119119
120120const style = computed ((): CSSProperties => {
121- const { isSidebarMixed, paddingTop, zIndex } = props ;
121+ const { isSidebarMixed, paddingTop, theme, zIndex } = props ;
122122
123123 return {
124+ ' --scroll-shadow' : theme === ' dark' ? ' var(--menu-dark)' : ' var(--menu)' ,
124125 ... calcMenuWidthStyle (false ),
125126 paddingTop: ` ${paddingTop }px ` ,
126127 zIndex ,
Original file line number Diff line number Diff line change @@ -28,18 +28,40 @@ function handleScroll(event: Event) {
2828
2929<template >
3030 <ScrollArea
31- :class =" [
32- cn(props.class),
33- {
34- // 'shadow-none': isAtTop && isAtBottom,
35- // shadow: !isAtTop || !isAtBottom,
36- // 'dark:shadow-white/20': !isAtTop || !isAtBottom,
37- // 'shadow-inner': !isAtBottom,
38- // 'dark:shadow-inner-white/20': !isAtBottom,
39- },
40- ]"
31+ :class =" [cn(props.class)]"
4132 :on-scroll =" handleScroll"
33+ class =" relative"
4234 >
35+ <div
36+ :class =" {
37+ 'opacity-100': !isAtTop,
38+ }"
39+ class =" scrollbar-top-shadow pointer-events-none absolute top-0 z-10 h-16 w-full opacity-0 transition-opacity duration-1000 ease-in-out will-change-[opacity]"
40+ ></div >
4341 <slot ></slot >
42+ <div
43+ :class =" {
44+ 'opacity-100': !isAtTop && !isAtBottom,
45+ }"
46+ class =" scrollbar-bottom-shadow pointer-events-none absolute bottom-0 z-10 h-16 w-full opacity-0 transition-opacity duration-1000 ease-in-out will-change-[opacity]"
47+ ></div >
4448 </ScrollArea >
4549</template >
50+
51+ <style scoped>
52+ .scrollbar-top-shadow {
53+ background : linear-gradient (
54+ to bottom ,
55+ hsl (var (--scroll-shadow , var (--background ))),
56+ transparent
57+ );
58+ }
59+
60+ .scrollbar-bottom-shadow {
61+ background : linear-gradient (
62+ to top ,
63+ hsl (var (--scroll-shadow , var (--background ))),
64+ transparent
65+ );
66+ }
67+ </style >
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ defineOptions({
1717});
1818
1919const modelValue = defineModel <string >({ default: ' auto' });
20- const appSemiDarkMenu = defineModel <boolean >(' appSemiDarkMenu ' , {
20+ const themeSemiDarkMenu = defineModel <boolean >(' themeSemiDarkMenu ' , {
2121 default: true ,
2222});
2323
@@ -75,7 +75,7 @@ function nameView(name: string) {
7575 </template >
7676
7777 <SwitchItem
78- v-model =" appSemiDarkMenu "
78+ v-model =" themeSemiDarkMenu "
7979 :disabled =" modelValue !== 'light'"
8080 class =" mt-6"
8181 >
Original file line number Diff line number Diff line change @@ -61,7 +61,6 @@ const appDynamicTitle = defineModel<boolean>('appDynamicTitle');
6161const appLayout = defineModel <LayoutType >(' appLayout' );
6262const appColorGrayMode = defineModel <boolean >(' appColorGrayMode' );
6363const appColorWeakMode = defineModel <boolean >(' appColorWeakMode' );
64- const appSemiDarkMenu = defineModel <boolean >(' appSemiDarkMenu' );
6564const appContentCompact = defineModel <ContentCompactType >(' appContentCompact' );
6665
6766const transitionProgress = defineModel <boolean >(' transitionProgress' );
@@ -73,6 +72,7 @@ const themeColorPrimary = defineModel<string>('themeColorPrimary');
7372const themeBuiltinType = defineModel <BuiltinThemeType >(' themeBuiltinType' );
7473const themeMode = defineModel <ThemeModeType >(' themeMode' );
7574const themeRadius = defineModel <string >(' themeRadius' );
75+ const themeSemiDarkMenu = defineModel <boolean >(' themeSemiDarkMenu' );
7676
7777const sidebarEnable = defineModel <boolean >(' sidebarEnable' );
7878const sidebarWidth = defineModel <number >(' sidebarWidth' );
@@ -269,7 +269,7 @@ async function handleReset() {
269269 <Block :title =" $t('preferences.theme.title')" >
270270 <Theme
271271 v-model =" themeMode"
272- v-model:app -semi-dark-menu =" appSemiDarkMenu "
272+ v-model:theme -semi-dark-menu =" themeSemiDarkMenu "
273273 />
274274 </Block >
275275 <!-- <Block :title="$t('preferences.theme-color')">
You can’t perform that action at this time.
0 commit comments