Skip to content

Commit 43ad820

Browse files
committed
chore: add styles for three dots menu
1 parent d4dcab3 commit 43ad820

File tree

3 files changed

+52
-6
lines changed

3 files changed

+52
-6
lines changed

adminforth/modules/styles.ts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,19 @@ export const styles = () => ({
227227
lightFiltersClearAllButtonTextHover: "alias:lightPrimary",
228228
lightFiltersClearAllButtonFocus: "#F3F4F6",
229229

230+
lightThreeDotsMenuIconBackground: "#FFFFFF",
231+
lightThreeDotsMenuIconBackgroundHover: "#F3F4F6",
232+
lightThreeDotsMenuIconBackgroundBorder: "#D1D5DB",
233+
lightThreeDotsMenuIconDots: "#111827",
234+
lightThreeDotsMenuIconDotsHover: "alias:lightPrimary",
235+
lightThreeDotsMenuIconFocus: "#F3F4F6",
236+
lightThreeDotsMenuBodyBackground: "#FFFFFF",
237+
lightThreeDotsMenuBodyBackgroundHover: "#F3F4F6",
238+
lightThreeDotsMenuBodyText: "#111827",
239+
lightThreeDotsMenuBodyTextHover: "#111827",
230240

231-
241+
242+
232243
// colors for dark theme
233244
darkHtml: "#111827",
234245

@@ -444,6 +455,18 @@ export const styles = () => ({
444455
darkShowTablesBodyBackground: "alias:darkForm",
445456
darkShowTableBodyText: "#9CA3AF",
446457
darkShowTableBodyBorder: "#F3F4F6",
458+
459+
darkThreeDotsMenuIconBackground: "#1F2937",
460+
darkThreeDotsMenuIconBackgroundHover: "#374151",
461+
darkThreeDotsMenuIconBackgroundBorder: "#4B5563",
462+
darkThreeDotsMenuIconDots: "#9CA3AF",
463+
darkThreeDotsMenuIconDotsHover: "#FFFFFF",
464+
darkThreeDotsMenuIconFocus: "#374151",
465+
darkThreeDotsMenuBodyBackground: "#374151",
466+
darkThreeDotsMenuBodyBackgroundHover: "#4B5563",
467+
darkThreeDotsMenuBodyText: "#9CA3AF",
468+
darkThreeDotsMenuBodyTextHover: "#FFFFFF",
469+
447470
},
448471
boxShadow: {
449472
customLight: "0 4px 8px rgba(0, 0, 0, 0.1)", // Lighter shadow

adminforth/spa/src/components/ThreeDotsMenu.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<template v-if="threeDotsDropdownItems?.length || customActions?.length">
33
<button
44
data-dropdown-toggle="listThreeDotsDropdown"
5-
class="flex items-center py-2 px-2 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded border border-gray-300 hover:bg-gray-100 hover:text-lightPrimary focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700 rounded-default"
5+
class="flex items-center py-2 px-2 text-sm font-medium text-lightThreeDotsMenuIconDots focus:outline-none bg-lightThreeDotsMenuIconBackground rounded border border-lightThreeDotsMenuIconBackgroundBorder hover:bg-lightThreeDotsMenuIconBackgroundHover hover:text-lightThreeDotsMenuIconDotsHover focus:z-10 focus:ring-4 focus:ring-lightThreeDotsMenuIconFocus dark:focus:ring-darkThreeDotsMenuIconFocus dark:bg-darkThreeDotsMenuIconBackground dark:text-darkThreeDotsMenuIconDots dark:border-darkThreeDotsMenuIconBackgroundBorder dark:hover:text-darkThreeDotsMenuIconDotsHover dark:hover:bg-darkThreeDotsMenuIconBackgroundHower rounded-default"
66
>
77
<svg class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 4 15">
88
<path d="M3.5 1.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm0 6.041a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm0 5.959a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"/>
@@ -12,10 +12,10 @@
1212
<!-- Dropdown menu -->
1313
<div
1414
id="listThreeDotsDropdown"
15-
class="z-20 hidden bg-white divide-y divide-gray-100 rounded-lg shadow w-44 dark:bg-gray-700 dark:divide-gray-600">
16-
<ul class="py-2 text-sm text-gray-700 dark:text-gray-200" aria-labelledby="dropdownMenuIconButton">
15+
class="z-20 hidden bg-lightThreeDotsMenuBodyBackground divide-y divide-gray-100 rounded-lg shadow w-44 dark:bg-darkThreeDotsMenuBodyBackground dark:divide-gray-600">
16+
<ul class="py-2 text-sm text-lightThreeDotsMenuBodyText dark:text-darkThreeDotsMenuBodyText" aria-labelledby="dropdownMenuIconButton">
1717
<li v-for="item in threeDotsDropdownItems" :key="`dropdown-item-${item.label}`">
18-
<a href="#" class="block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white">
18+
<a href="#" class="block px-4 py-2 hover:bg-lightThreeDotsMenuBodyBackgroundHover hover:text-lightThreeDotsMenuBodyTextHover dark:hover:bg-darkThreeDotsMenuBodyBackgroundHover dark:hover:text-darkThreeDotsMenuBodyTextHover">
1919
<component :is="getCustomComponent(item)"
2020
:meta="item.meta"
2121
:resource="coreStore.resource"
@@ -24,7 +24,7 @@
2424
</a>
2525
</li>
2626
<li v-for="action in customActions" :key="action.id">
27-
<a href="#" @click.prevent="handleActionClick(action)" class="block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white">
27+
<a href="#" @click.prevent="handleActionClick(action)" class="block px-4 py-2 hover:text-lightThreeDotsMenuBodyTextHover hover:bg-lightThreeDotsMenuBodyBackgroundHover dark:hover:bg-darkThreeDotsMenuBodyBackgroundHover dark:hover:text-darkThreeDotsMenuBodyTextHover">
2828
<div class="flex items-center gap-2">
2929
<component
3030
v-if="action.icon"

dev-demo/index.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,18 @@ export const admin = new AdminForth({
350350
FiltersClearAllButtonText: "alias:lightFiltersClearAllButtonBackground inverse",
351351
FiltersClearAllButtonTextHover: "alias:lightFiltersClearAllButtonText darken",
352352
FiltersClearAllButtonFocus: "alias:lightFiltersClearAllButtonBackground opacity:0.6",
353+
354+
ThreeDotsMenuIconBackground: "alias:lightPrimary lighten",
355+
ThreeDotsMenuIconBackgroundHover: "alias:lightPrimary opacity:0.5",
356+
ThreeDotsMenuIconBackgroundBorder: "alias:lightPrimary darken",
357+
ThreeDotsMenuIconDots: "alias:lightThreeDotsMenuIconBackground inverse",
358+
ThreeDotsMenuIconDotsHover: "alias:lightThreeDotsMenuIconDots opacity:0.3",
359+
ThreeDotsMenuIconFocus: "alias:lightThreeDotsMenuIconBackground opacity:0.2",
360+
ThreeDotsMenuBodyBackground: "alias:lightThreeDotsMenuIconBackground",
361+
ThreeDotsMenuBodyBackgroundHover: "alias:lightThreeDotsMenuBodyBackground darken",
362+
ThreeDotsMenuBodyText: "alias:lightThreeDotsMenuIconDots",
363+
ThreeDotsMenuBodyTextHover: "alias:lightlightThreeDotsMenuIconDots opacity:0.8",
364+
353365
},
354366
dark: {
355367
primary: '#bd1a76',
@@ -529,6 +541,17 @@ export const admin = new AdminForth({
529541
FiltersClearAllButtonText: "alias:darkFiltersClearAllButtonBackground inverse",
530542
FiltersClearAllButtonTextHover: "alias:darkFiltersClearAllButtonText darken",
531543
FiltersClearAllButtonFocus: "alias:darkFiltersClearAllButtonBackground opacity:0.6",
544+
545+
ThreeDotsMenuIconBackground: "alias:darkPrimary lighten",
546+
ThreeDotsMenuIconBackgroundHover: "alias:darkPrimary opacity:0.5",
547+
ThreeDotsMenuIconBackgroundBorder: "alias:darkPrimary darken",
548+
ThreeDotsMenuIconDots: "alias:darkThreeDotsMenuIconBackground inverse",
549+
ThreeDotsMenuIconDotsHover: "alias:darkThreeDotsMenuIconDots opacity:0.3",
550+
ThreeDotsMenuIconFocus: "alias:darkThreeDotsMenuIconBackground opacity:0.2",
551+
ThreeDotsMenuBodyBackground: "alias:darkThreeDotsMenuIconBackground",
552+
ThreeDotsMenuBodyBackgroundHover: "alias:darkThreeDotsMenuBodyBackground darken",
553+
ThreeDotsMenuBodyText: "alias:darkThreeDotsMenuIconDots",
554+
ThreeDotsMenuBodyTextHover: "alias:darkThreeDotsMenuIconDots opacity:0.8",
532555
}
533556
}
534557
},

0 commit comments

Comments
 (0)