@@ -11,6 +11,8 @@ const { t } = useI18n();
11
11
const mode = useColorMode <CustomTheme >({
12
12
attribute: " data-theme" ,
13
13
modes: {
14
+ light: " light" ,
15
+ dark: " dark" ,
14
16
cupcake: " cupcake" ,
15
17
bumblebee: " bumblebee" ,
16
18
emerald: " emerald" ,
@@ -38,6 +40,12 @@ const mode = useColorMode<CustomTheme>({
38
40
night: " night" ,
39
41
coffee: " coffee" ,
40
42
winter: " winter" ,
43
+ dim: " dim" ,
44
+ nord: " nord" ,
45
+ sunset: " sunset" ,
46
+ caramellatte: " caramellatte" ,
47
+ abyss: " abyss" ,
48
+ silk: " silk" ,
41
49
},
42
50
});
43
51
@@ -89,69 +97,44 @@ function handleKeyDown(event: KeyboardEvent, theme: CustomTheme) {
89
97
90
98
<template >
91
99
<div title =" Change Theme" class =" dropdown dropdown-end" >
92
- <div tabindex =" 0" class =" gap-1 normal-case btn btn-ghost" >
100
+ <div tabindex =" 0" role = " button " class =" gap-1 btn btn-ghost btn-sm " aria-label = " Change Theme " >
93
101
<UnoCSSIconButton icon =" i-tabler-color-swatch" />
94
102
<span class =" hidden md:inline" >{{ t("Themes") }}</span >
95
103
<UnoCSSIconButton icon =" i-tabler-chevron-down" />
96
104
</div >
97
- <div
98
- class =" dropdown-content scrollbar top-px mt-16 h-[70vh] max-h-96 w-52 overflow-y-auto bg-base-200 text-base-content shadow-2xl rounded-t-box rounded-b-box"
99
- >
100
- <div class =" grid grid-cols-1 gap-3 p-3" tabindex =" 0" >
101
- <button
102
- v-for =" theme in themeList"
103
- :key =" theme.id"
104
- class =" overflow-hidden rounded-lg text-left outline-2 outline-base-content outline-offset-2 hover:outline"
105
- :class =" mode === theme.id ? 'outline' : ''"
106
- type =" button"
107
- @click =" changeTheme($event, theme.id)"
108
- @keydown =" handleKeyDown($event, theme.id)"
109
- >
110
- <div
111
- :data-theme =" theme.id"
112
- class =" w-full cursor-pointer bg-base-100 text-base-content font-sans"
105
+ <div tabindex =" 0" class =" bg-base-200 text-base-content mt-16 outline-1 outline-black/5 border border-white/5 h-[30.5rem] max-h-[calc(100vh-8.6rem)] shadow-2xl top-px overflow-y-auto dropdown-content rounded-box" >
106
+ <ul class =" w-56 menu" >
107
+ <li class =" text-xs menu-title" >
108
+ {{ t("Themes") }}
109
+ </li >
110
+ <li v-for =" theme in themeList" :key =" theme.id" >
111
+ <button
112
+ class =" px-2 gap-3"
113
+ :class =" mode === theme.id ? '[& _svg]:visible' : ''"
114
+ @click =" changeTheme($event, theme.id)"
115
+ @keydown =" handleKeyDown($event, theme.id)"
113
116
>
114
- <div class =" grid grid-cols-5 grid-rows-3" >
115
- <div class =" col-span-5 row-span-3 row-start-1 flex gap-1 px-4 py-3" >
116
- <div class =" grow text-sm font-bold" >
117
- {{ theme.id }}
118
- </div >
119
- <div class =" flex shrink-0 flex-wrap gap-1" >
120
- <div class =" w-2 rounded bg-primary" />
121
- <div class =" w-2 rounded bg-secondary" />
122
- <div class =" w-2 rounded bg-accent" />
123
- <div class =" w-2 rounded bg-neutral" />
124
- </div >
125
- </div >
117
+ <div :data-theme =" theme.id" class =" bg-base-100 p-1 rounded-md shrink-0 gap-0.5 grid grid-cols-2 shadow-sm" >
118
+ <div class =" bg-base-content rounded-full size-1" />
119
+ <div class =" bg-primary rounded-full size-1" />
120
+ <div class =" bg-secondary rounded-full size-1" />
121
+ <div class =" bg-accent rounded-full size-1" />
126
122
</div >
127
- </div >
128
- </button >
129
- </div >
123
+ <div class =" w-32 truncate" >
124
+ {{ theme.id }}
125
+ </div >
126
+ <svg xmlns =" http://www.w3.org/2000/svg" width =" 16" height =" 16" viewBox =" 0 0 24 24" fill =" currentColor" class =" shrink-0 h-3 w-3 invisible" >
127
+ <path d =" M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z" />
128
+ </svg >
129
+ </button >
130
+ </li >
131
+ <li />
132
+ </ul >
130
133
</div >
131
134
</div >
132
135
</template >
133
136
134
- <style scoped>
135
- .scrollbar ::-webkit-scrollbar {
136
- width : 20px ;
137
- height : 20px ;
138
- }
139
-
140
- .scrollbar ::-webkit-scrollbar-track {
141
- border-radius : 100vh ;
142
- background : #f7f4ed ;
143
- }
144
-
145
- .scrollbar ::-webkit-scrollbar-thumb {
146
- background : #e0cbcb ;
147
- border-radius : 100vh ;
148
- border : 3px solid #f6f7ed ;
149
- }
150
-
151
- .scrollbar ::-webkit-scrollbar-thumb :hover {
152
- background : #c0a0b9 ;
153
- }
154
-
137
+ <style scoped>
155
138
::view-transition-old(root),
156
139
::view-transition-new(root) {
157
140
animation : none ;
0 commit comments