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 => {
118
118
});
119
119
120
120
const style = computed ((): CSSProperties => {
121
- const { isSidebarMixed, paddingTop, zIndex } = props ;
121
+ const { isSidebarMixed, paddingTop, theme, zIndex } = props ;
122
122
123
123
return {
124
+ ' --scroll-shadow' : theme === ' dark' ? ' var(--menu-dark)' : ' var(--menu)' ,
124
125
... calcMenuWidthStyle (false ),
125
126
paddingTop: ` ${paddingTop }px ` ,
126
127
zIndex ,
Original file line number Diff line number Diff line change @@ -28,18 +28,40 @@ function handleScroll(event: Event) {
28
28
29
29
<template >
30
30
<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)]"
41
32
:on-scroll =" handleScroll"
33
+ class =" relative"
42
34
>
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 >
43
41
<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 >
44
48
</ScrollArea >
45
49
</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({
17
17
});
18
18
19
19
const modelValue = defineModel <string >({ default: ' auto' });
20
- const appSemiDarkMenu = defineModel <boolean >(' appSemiDarkMenu ' , {
20
+ const themeSemiDarkMenu = defineModel <boolean >(' themeSemiDarkMenu ' , {
21
21
default: true ,
22
22
});
23
23
@@ -75,7 +75,7 @@ function nameView(name: string) {
75
75
</template >
76
76
77
77
<SwitchItem
78
- v-model =" appSemiDarkMenu "
78
+ v-model =" themeSemiDarkMenu "
79
79
:disabled =" modelValue !== 'light'"
80
80
class =" mt-6"
81
81
>
Original file line number Diff line number Diff line change @@ -61,7 +61,6 @@ const appDynamicTitle = defineModel<boolean>('appDynamicTitle');
61
61
const appLayout = defineModel <LayoutType >(' appLayout' );
62
62
const appColorGrayMode = defineModel <boolean >(' appColorGrayMode' );
63
63
const appColorWeakMode = defineModel <boolean >(' appColorWeakMode' );
64
- const appSemiDarkMenu = defineModel <boolean >(' appSemiDarkMenu' );
65
64
const appContentCompact = defineModel <ContentCompactType >(' appContentCompact' );
66
65
67
66
const transitionProgress = defineModel <boolean >(' transitionProgress' );
@@ -73,6 +72,7 @@ const themeColorPrimary = defineModel<string>('themeColorPrimary');
73
72
const themeBuiltinType = defineModel <BuiltinThemeType >(' themeBuiltinType' );
74
73
const themeMode = defineModel <ThemeModeType >(' themeMode' );
75
74
const themeRadius = defineModel <string >(' themeRadius' );
75
+ const themeSemiDarkMenu = defineModel <boolean >(' themeSemiDarkMenu' );
76
76
77
77
const sidebarEnable = defineModel <boolean >(' sidebarEnable' );
78
78
const sidebarWidth = defineModel <number >(' sidebarWidth' );
@@ -269,7 +269,7 @@ async function handleReset() {
269
269
<Block :title =" $t('preferences.theme.title')" >
270
270
<Theme
271
271
v-model =" themeMode"
272
- v-model:app -semi-dark-menu =" appSemiDarkMenu "
272
+ v-model:theme -semi-dark-menu =" themeSemiDarkMenu "
273
273
/>
274
274
</Block >
275
275
<!-- <Block :title="$t('preferences.theme-color')">
You can’t perform that action at this time.
0 commit comments