app.blade.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <!DOCTYPE html>
  2. <html lang="{{ str_replace('_', '-', app()->getLocale()) }}" @class(['dark' => ($appearance ?? 'system') == 'dark'])>
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1" />
  6. {{-- Inline script to detect system dark mode preference and apply it immediately --}}
  7. <script>
  8. (function () {
  9. const appearance = '{{ $appearance ?? 'system' }}';
  10. if (appearance === 'system') {
  11. const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
  12. if (prefersDark) {
  13. document.documentElement.classList.add('dark');
  14. }
  15. }
  16. })();
  17. </script>
  18. {{-- Inline style to set the HTML background color based on our theme in app.css --}}
  19. <style>
  20. html {
  21. background-color: oklch(1 0 0);
  22. }
  23. html.dark {
  24. background-color: oklch(0.145 0 0);
  25. }
  26. </style>
  27. <title inertia>{{ config('app.name', 'Laravel') }}</title>
  28. <link rel="icon" href="/favicon.ico" sizes="any" />
  29. <link rel="icon" href="/favicon.svg" type="image/svg+xml" />
  30. <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
  31. <link rel="preconnect" href="https://fonts.bunny.net" />
  32. <link href="https://fonts.bunny.net/css?family=instrument-sans:400,500,600" rel="stylesheet" />
  33. @viteReactRefresh
  34. @vite(['resources/js/app.tsx', "resources/js/pages/{$page['component']}.tsx"])
  35. @inertiaHead
  36. </head>
  37. <body class="font-sans antialiased">
  38. @inertia
  39. </body>
  40. </html>