From 60c82afe5a56910a852bd5917c24248d8213915c Mon Sep 17 00:00:00 2001 From: ignacionelson Date: Tue, 29 Sep 2026 17:51:47 -0300 Subject: [PATCH] Let an installed package restyle the staff area and supply its own browser icons Core imports any stylesheet a package ships under resources/css after its own app.css, and marks the pieces worth restyling with data attributes: the staff shell (data-surface="staff"), the header, cards, buttons with their variant, list toolbars, table frames and the default logo marks. The layout takes its icons from projectsend.icons when a package names some, replacing the defaults as a set. Core names no package and no style. With nothing installed that ships a stylesheet or icons, nothing renders differently. --- resources/js/app.tsx | 5 +++++ resources/js/components/app-logo-icon.tsx | 4 +++- resources/js/components/app-shell.tsx | 8 ++++++-- resources/js/components/app-sidebar-header.tsx | 5 ++++- .../js/components/dashboard-widgets/widget-box.tsx | 1 + resources/js/components/list-toolbar.tsx | 2 +- resources/js/components/projectsend-logo.tsx | 4 +++- resources/js/components/table-shell.tsx | 2 +- resources/js/components/ui/button.tsx | 2 +- resources/js/components/ui/card.tsx | 2 +- resources/views/app.blade.php | 13 ++++++++++--- 11 files changed, 36 insertions(+), 12 deletions(-) diff --git a/resources/js/app.tsx b/resources/js/app.tsx index 1a51f6e3..8b0a3a63 100644 --- a/resources/js/app.tsx +++ b/resources/js/app.tsx @@ -1,5 +1,10 @@ import '../css/app.css'; +// Stylesheets an installed package ships under resources/css, the styling +// counterpart of the package pages resolved below. Imported after app.css so +// a package can restyle what core draws; core names no package and no style. +import.meta.glob('../../vendor/*/*/resources/css/*.css', { eager: true }); + import { createInertiaApp, router } from '@inertiajs/react'; import axios from 'axios'; import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers'; diff --git a/resources/js/components/app-logo-icon.tsx b/resources/js/components/app-logo-icon.tsx index e8ec9d59..6c816fb9 100644 --- a/resources/js/components/app-logo-icon.tsx +++ b/resources/js/components/app-logo-icon.tsx @@ -7,7 +7,9 @@ export default function AppLogoIcon(props: SVGAttributes) { const gradientId = useId(); return ( - + // Marked so an installed package can restyle the default mark; only + // drawn when no logo was uploaded in Branding, which always wins. + diff --git a/resources/js/components/app-shell.tsx b/resources/js/components/app-shell.tsx index 1e576119..a561f184 100644 --- a/resources/js/components/app-shell.tsx +++ b/resources/js/components/app-shell.tsx @@ -18,11 +18,15 @@ export function AppShell({ children, variant = 'header' }: AppShellProps) { }; if (variant === 'header') { - return
{children}
; + return ( +
+ {children} +
+ ); } return ( - + {children} ); diff --git a/resources/js/components/app-sidebar-header.tsx b/resources/js/components/app-sidebar-header.tsx index 7bb552fa..520ba31f 100644 --- a/resources/js/components/app-sidebar-header.tsx +++ b/resources/js/components/app-sidebar-header.tsx @@ -9,7 +9,10 @@ import { type BreadcrumbItem as BreadcrumbItemType } from '@/types'; export function AppSidebarHeader({ breadcrumbs = [] }: { breadcrumbs?: BreadcrumbItemType[] }) { return ( -
+
diff --git a/resources/js/components/dashboard-widgets/widget-box.tsx b/resources/js/components/dashboard-widgets/widget-box.tsx index 6eb7c18b..01a73a95 100644 --- a/resources/js/components/dashboard-widgets/widget-box.tsx +++ b/resources/js/components/dashboard-widgets/widget-box.tsx @@ -23,6 +23,7 @@ export function WidgetBox({ id, title, headerExtra, children }: { id: string; ti
diff --git a/resources/js/components/list-toolbar.tsx b/resources/js/components/list-toolbar.tsx index 67b9342a..db357125 100644 --- a/resources/js/components/list-toolbar.tsx +++ b/resources/js/components/list-toolbar.tsx @@ -12,7 +12,7 @@ export function ListToolbar({ children, showClear, onClear }: { children: ReactN const { t } = useTranslation(); return ( -
+
{children} {showClear && (