($appearance ?? 'system') == 'dark'])> {{-- Inline script to detect system dark mode preference and apply it immediately --}} {{-- Inline style to set the HTML background color based on our theme in app.css --}} @fonts @vite(['resources/css/app.css', 'resources/js/app.ts']) {{-- Preload ONLY the current page component's own CSS to avoid a flash of unstyled content. We read it directly from the Vite manifest instead of passing the component to @vite(), because @vite() recursively walks the component's JS import graph to emit modulepreload tags — on heavy pages that deep traversal can overflow the PHP-FPM worker stack and 500 the full-page render. Reading the entry's `css` array is non-recursive and guarded so a missing manifest/key can never throw. --}} @php $componentCss = []; $manifestPath = collect([ public_path('build/manifest.json'), public_path('build/.vite/manifest.json'), ])->first(fn (string $path): bool => is_file($path)); if ($manifestPath !== null) { $manifest = json_decode((string) file_get_contents($manifestPath), true) ?: []; $componentCss = $manifest["resources/js/pages/{$page['component']}.vue"]['css'] ?? []; } @endphp @foreach ($componentCss as $componentStylesheet) @endforeach {{ config('app.name', 'TradiXor') }}