Respect's avatar

How to custom css and js file in the laravel app with tailwind css configs

  • hello how to make custom css and js in the app for example app.css & admin.css & app.js & admin.js ( in my laravel livewire app ) with tailwind css - becasue i need make dffrent configs in each file and override colors for example
  • i have app.blade.php
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">

<head>
    @vite('resources/css/app.css')
    @livewireStyles
</head>

<body>
  
    {{ $slot }}
 
    @vite('resources/js/app.js')
</body>

</html>
  • i have app-admin.blade.php
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">

<head>
    @vite('resources/css/admin.css')
    @livewireStyles
</head>

<body>
  
    {{ $slot }}
 
    @vite('resources/js/admin.js')
</body>

</html>
0 likes
3 replies
Respect's avatar

thx for answer but i need seperate files becuase may be add some custom css with same class names no need any confliction .so that iam asking about seperating fiel btween admin and website frontend

Tray2's avatar

You really don't, you can just add whatever classes you need for each view/component.

Admin

<div class="bg-blue-600">

User

<div class="bg-pink-300">

And if you use components just pass the class that differs as a prop.

Please or to participate in this conversation.