Skip to content

Commit 228ac64

Browse files
committed
chore: add styles for the show view
1 parent 1d786cc commit 228ac64

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed

adminforth/modules/styles.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,13 @@ export const styles = () => ({
278278
lightListViewButtonFocusRing: "#F3F4F6",
279279
lightListViewButtonBorder: "#D1D5DB",
280280

281+
/* Show View */
282+
lightShowViewButtonBackground: "#FFFFFF",
283+
lightShowViewButtonBackgroundHover: "#F3F4F6",
284+
lightShowViewButtonText: "#111827",
285+
lightShowViewButtonTextHover: "alias:lightPrimary",
286+
lightShowViewButtonFocusRing: "#F3F4F6",
287+
lightShowViewButtonBorder: "#D1D5DB",
281288

282289
/* Login View */
283290
lightLoginViewBackground: "#FFFFFF",
@@ -556,6 +563,14 @@ export const styles = () => ({
556563
darkListViewButtonFocusRing: "#374151",
557564
darkListViewButtonBorder: "#4B5563",
558565

566+
/* Show View */
567+
darkShowViewButtonBackground: "#1F2937",
568+
darkShowViewButtonBackgroundHover: "#374151",
569+
darkShowViewButtonText: "#9CA3AF",
570+
darkShowViewButtonTextHover: "#FFFFFF",
571+
darkShowViewButtonFocusRing: "#374151",
572+
darkShowViewButtonBorder: "#4B5563",
573+
559574
/* Login view */
560575
darkLoginViewBackground: "#374151",
561576
darkLoginViewTextColor: "#FFFFFF",

adminforth/spa/src/views/ShowView.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,21 @@
2828
</template>
2929
<RouterLink v-if="coreStore.resource?.options?.allowedActions?.create"
3030
:to="{ name: 'resource-create', params: { resourceId: $route.params.resourceId } }"
31-
class="af-add-new-button flex items-center py-1 px-3 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"
31+
class="af-add-new-button flex items-center py-1 px-3 text-sm font-medium text-lightShowViewButtonText focus:outline-none bg-lightShowViewButtonBackground rounded border border-lightShowViewButtonBorder hover:bg-lightShowViewButtonBackgroundHover hover:text-lightShowViewButtonTextHover focus:z-10 focus:ring-4 focus:ring-lightShowViewButtonFocusRing dark:focus:ring-darkShowViewButtonFocusRing dark:bg-darkShowViewButtonBackground dark:text-darkShowViewButtonText dark:border-darkShowViewButtonBorder dark:hover:text-darkShowViewButtonTextHover dark:hover:bg-darkShowViewButtonBackgroundHover rounded-default"
3232
>
3333
<IconPlusOutline class="w-4 h-4 me-2"/>
3434
{{ $t('Add new') }}
3535
</RouterLink>
3636

3737
<RouterLink v-if="coreStore?.resourceOptions?.allowedActions?.edit" :to="{ name: 'resource-edit', params: { resourceId: $route.params.resourceId, primaryKey: $route.params.primaryKey } }"
38-
class="flex items-center af-edit-button py-1 px-3 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-default 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"
38+
class="flex items-center af-edit-button py-1 px-3 text-sm font-medium text-lightShowViewButtonText focus:outline-none bg-lightShowViewButtonBackground rounded-default border border-lightShowViewButtonBorder hover:bg-lightShowViewButtonBackgroundHover hover:text-lightShowViewButtonTextHover focus:z-10 focus:ring-4 focus:ring-lightShowViewButtonFocusRing dark:focus:ring-darkShowViewButtonFocusRing dark:bg-darkShowViewButtonBackground dark:text-darkShowViewButtonText dark:border-darkShowViewButtonBorder dark:hover:text-darkShowViewButtonTextHover dark:hover:bg-darkShowViewButtonBackgroundHover"
3939
>
4040
<IconPenSolid class="w-4 h-4" />
4141
{{ $t('Edit') }}
4242
</RouterLink>
4343

4444
<button v-if="coreStore?.resourceOptions?.allowedActions?.delete" @click="deleteRecord"
45-
class="flex items-center af-delete-button py-1 px-3 text-sm font-medium rounded-default text-red-600 focus:outline-none bg-white border border-gray-300 hover:bg-gray-100 hover:text-red-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-red-500 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700"
45+
class="flex items-center af-delete-button py-1 px-3 text-sm font-medium rounded-default text-red-600 focus:outline-none bg-lightShowViewButtonBackground border border-lightShowViewButtonBorder hover:bg-lightShowViewButtonBackgroundHover hover:text-red-700 focus:z-10 focus:ring-4 focus:ring-lightShowViewButtonFocusRing dark:focus:ring-darkShowViewButtonFocusRing dark:bg-darkShowViewButtonBackground dark:text-red-500 dark:border-darkShowViewButtonBorder dark:hover:text-darkShowViewButtonTextHover dark:hover:bg-darkShowViewButtonBackgroundHover"
4646
>
4747
<IconTrashBinSolid class="w-4 h-4" />
4848
{{ $t('Delete') }}

dev-demo/index.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,13 @@ export const admin = new AdminForth({
396396
ListViewButtonTextHover: "alias:lightListViewButtonText opacity:0.8",
397397
ListViewButtonFocusRing: "alias:lightlistViewButtonBackground",
398398
ListViewButtonBorder: "alias:lightListViewButtonBackground darken",
399+
400+
ShowViewButtonBackground: "alias:lightPrimary",
401+
ShowViewButtonBackgroundHover: "alias:lightShowViewButtonBackground lighten",
402+
ShowViewButtonText: "alias:lightShowViewButtonBackground inverse",
403+
ShowViewButtonTextHover: "alias:lightShowViewButtonText opacity:0.8",
404+
ShowViewButtonFocusRing: "alias:lightShowViewButtonBackground",
405+
ShowViewButtonBorder: "alias:lightShowViewButtonBackground darken",
399406

400407
LoginViewBackground: "alias:lightPrimary lighten",
401408
LoginViewTextColor: "alias:lightLoginViewBackground inverse",
@@ -632,6 +639,13 @@ export const admin = new AdminForth({
632639
ListViewButtonFocusRing: "alias:darklistViewButtonBackground",
633640
ListViewButtonBorder: "alias:darkListViewButtonBackground darken",
634641

642+
ShowViewButtonBackground: "alias:darkPrimary",
643+
ShowViewButtonBackgroundHover: "alias:darkShowViewButtonBackground lighten",
644+
ShowViewButtonText: "alias:darkShowViewButtonBackground inverse",
645+
ShowViewButtonTextHover: "alias:darkShowViewButtonText opacity:0.8",
646+
ShowViewButtonFocusRing: "alias:darkShowViewButtonBackground",
647+
ShowViewButtonBorder: "alias:darkShowViewButtonBackground darken",
648+
635649
LoginViewBackground: "alias:darkPrimary lighten",
636650
LoginViewTextColor: "alias:darkLoginViewBackground inverse",
637651
LoginViewSubTextColor: "alias:darkLoginViewTextColor opacity:0.8",

0 commit comments

Comments
 (0)