0

I'm using laravel breeze in my eCommerce laravel project, but the styling is not working. I have tried many solutions but still the same. Should I install a tailwind package or what?

here is my app.blade.php

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="csrf-token" content="{{ csrf_token() }}">

        <title>{{ config('app.name', 'Laravel') }}</title>


        <!-- Fonts -->
        <link rel="preconnect" href="https://fonts.bunny.net">
        <link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />


        <!-- Scripts -->
        @vite(['resources/css/app.css', 'resources/js/app.js'])
    </head>
    <body class="font-sans antialiased">
        <div class="min-h-screen bg-gray-100">
            @include('layouts.navigation')

            <!-- Page Heading -->
            @isset($header)
                <header class="bg-white shadow">
                    <div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
                        {{ $header }}
                    </div>
                </header>
            @endisset

            <!-- Page Content -->
            <main>
                {{ $slot }}
            </main>
        </div>
    </body>
</html>

and this is the guest.blade.php

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="csrf-token" content="{{ csrf_token() }}">

        <title>{{ config('app.name', 'Laravel') }}</title>

        <!-- Fonts -->
        <link rel="preconnect" href="https://fonts.bunny.net">
        <link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />

        <!-- Scripts -->
        @vite(['resources/css/app.css', 'resources/js/app.js'])
    </head>
    <body class="font-sans text-gray-900 antialiased">
        <div class="min-h-screen flex flex-col sm:justify-center items-center pt-6 sm:pt-0 bg-gray-100">
            <div>
                <a href="/">
                    <x-application-logo class="w-20 h-20 fill-current text-gray-500" />
                </a>
            </div>

            <div class="w-full sm:max-w-md mt-6 px-6 py-4 bg-white shadow-md overflow-hidden sm:rounded-lg">
                {{ $slot }}
            </div>
        </div>
    </body>
</html>

I have tried all posted solutions, I have used this <link rel="stylesheet" href="{{ asset('css/app.css') }}"> <script src="{{ asset('js/app.js') }}" defer></script>

also my app.css file is empty, and I tried putting this in it and it didn't work

@tailwind base;
@tailwind components;
@tailwind utilities;

even when using @import it didn't work

I'm running the npm too

I forgot to inform that the page showing only images and html without any styling

When I Created a new laravel Project and used breeze it worked. Do you know why it doesn't work on my main project?

9
  • Don't believe old answers. If npm run build doesn't solve your problem, you're doing something wrong that's not in the question.
    – puklipo
    Commented Jul 8 at 23:51
  • It didn't work, The page is only showing images and html. there is no css. I tried to use a package to change the breeze style but the same problem apeared Commented Jul 9 at 0:05
  • If you're on the development platform try to npm run dev and when you want to ship your project execute npm run build. Commented Jul 9 at 6:22
  • Are the css that you mentioned only from app.css? Or did you create new css files? If you created new css files, make sure that they are declared in your vite.config file Commented Jul 9 at 7:23
  • @Mr.Kenneth I'm not using other css file. Commented Jul 9 at 11:00

0