Skip to content

Commit 2619a68

Browse files
committed
chore: add styles for show table
1 parent 8a023b8 commit 2619a68

File tree

3 files changed

+37
-5
lines changed

3 files changed

+37
-5
lines changed

adminforth/modules/styles.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ export const styles = () => ({
5252
lightFormHeading: "alias:lightListTableHeading", // show view heading
5353
lightFormFieldTextColor: "alias:lightListTableText",
5454

55+
lightShowTableHeadingBackground: "alias:lightFormHeading",
56+
lightShowTableHeadingText: "#374151",
57+
lightShowTableUnderHeadingBackground: "alias:lightFormHeading",
58+
lightShowTableUnderHeadingText: "#374151",
59+
lightShowTablesBodyBackground: "alias:lightForm",
60+
lightShowTableBodyText: "#6B7280",
61+
lightShowTableBodyBorder: "#F3F4F6",
62+
5563
lightButtons: "#FFFFFF", // button background
5664
lightButtonsBorder: "#DDDDDD", // button border
5765
lightButtonsText: "#111827", // button text
@@ -428,6 +436,14 @@ export const styles = () => ({
428436
darkFiltersClearAllButtonText: "#9CA3AF",
429437
darkFiltersClearAllButtonTextHover: "#FFFFFF",
430438
darkFiltersClearAllButtonFocus: "#374151",
439+
440+
darkShowTableHeadingBackground: "alias:darkFormHeading",
441+
darkShowTableHeadingText: "#9CA3AF",
442+
darkShowTableUnderHeadingBackground: "alias:darkFormHeading",
443+
darkShowTableUnderHeadingText: "#9CA3AF",
444+
darkShowTablesBodyBackground: "alias:darkForm",
445+
darkShowTableBodyText: "#9CA3AF",
446+
darkShowTableBodyBorder: "#F3F4F6",
431447
},
432448
boxShadow: {
433449
customLight: "0 4px 8px rgba(0, 0, 0, 0.1)", // Lighter shadow

adminforth/spa/src/components/ShowTable.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<template>
22
<div :class="`overflow-x-auto ${isRounded ? 'rounded-default' : ''} shadow-resourseFormShadow dark:shadow-darkResourseFormShadow`">
3-
<div v-if="groupName && !noTitle" class="text-md font-semibold px-6 py-3 flex flex-1 items-center text-gray-700 bg-lightFormHeading dark:bg-darkFormHeading dark:text-gray-400 rounded-t-lg">
3+
<div v-if="groupName && !noTitle" class="text-md font-semibold px-6 py-3 flex flex-1 items-center text-lightShowTableHeadingText bg-lightShowTableHeadingBackground dark:bg-darkShowTableHeadingBackground dark:text-darkShowTableHeadingText rounded-t-lg">
44
{{ groupName }}
55
</div>
6-
<table class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400 table-fixed">
7-
<thead v-if="!allColumnsHaveCustomComponent" class="text-gray-700 dark:text-gray-400 bg-lightFormHeading dark:bg-darkFormHeading dark:border-darkFormBorder block md:table-row-group">
6+
<table class="w-full text-sm text-left rtl:text-right text-lightShowTableBodyText dark:text-darkShowTableBodyText table-fixed">
7+
<thead v-if="!allColumnsHaveCustomComponent" class="text-lightShowTableUnderHeadingText dark:text-darkShowTableUnderHeadingText bg-lightShowTableUnderHeadingBackground dark:bg-darkShowTableUnderHeadingBackground dark:border-darkFormBorder block md:table-row-group">
88
<tr>
99
<th scope="col" class="px-6 py-3 text-xs uppercase hidden md:w-52 md:table-cell">
1010
{{ $t('Field') }}
@@ -18,8 +18,8 @@
1818
<tr
1919
v-for="column in columns"
2020
:key="column.name"
21-
class="bg-lightForm border-t border-gray-100
22-
dark:bg-darkForm dark:border-darkFormBorder block md:table-row"
21+
class="bg-lightShowTablesBodyBackground border-t border-lightShowTableBodyBorder
22+
dark:bg-darkShowTablesBodyBackground dark:border-darkShowTableBodyBorder block md:table-row"
2323
>
2424
<component
2525
v-if="column.components?.showRow"

dev-demo/index.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,14 @@ export const admin = new AdminForth({
178178
FormHeading: "alias:lightListTableHeading",
179179
FormFieldTextColor: "alias:lightListTableText",
180180

181+
ShowTableHeadingBackground: "alias:lightPrimary",
182+
ShowTableHeadingText: "alias:lightShowTableHeadingBackground inverse",
183+
ShowTableUnderHeadingBackground: "alias:lightShowTableHeadingBackground lighten",
184+
ShowTableUnderHeadingText: "alias:lightShowTableUnderHeadingBackground inverse",
185+
ShowTablesBodyBackground: "alias:lightShowTableUnderHeadingBackground lighten",
186+
ShowTableBodyText: "alias:lightShowTablesBodyBackground inverse",
187+
ShowTableBodyBorder: "alias:lightShowTableHeadingBackground darken",
188+
181189
Buttons: "#FFFFFF",
182190
ButtonsBorder: "#DDDDDD",
183191
ButtonsText: "#111827",
@@ -368,6 +376,14 @@ export const admin = new AdminForth({
368376
FormHeading: "alias:darkListTableHeading",
369377
FormFieldTextColor: "alias:darkListTableText",
370378

379+
ShowTableHeadingBackground: "alias:darkPrimary",
380+
ShowTableHeadingText: "alias:darkShowTableHeadingBackground inverse",
381+
ShowTableUnderHeadingBackground: "alias:darkShowTableHeadingBackground lighten",
382+
ShowTableUnderHeadingText: "alias:darkShowTableUnderHeadingBackground inverse",
383+
ShowTablesBodyBackground: "alias:darkShowTableUnderHeadingBackground lighten",
384+
ShowTableBodyText: "alias:darkShowTablesBodyBackground inverse",
385+
ShowTableBodyBorder: "alias:darkShowTableHeadingBackground darken",
386+
371387
DropdownButtonsBackground: "alias:darkForm darken",
372388
DropownButtonsBorder: "alias:darkForm lighten",
373389
DropdownButtonsText: "alias:darkListTableText",

0 commit comments

Comments
 (0)