Custom style can't be added to login #5406
Replies: 3 comments
-
Workaround: First copy view layout.blade.php from Nova to your app mkdir -p resources/views/vendor/nova/auth/ && cp vendor/laravel/nova/resources/views/auth/layout.blade.php resources/views/vendor/nova/auth/ Then to file <link rel="stylesheet" href="{{ asset('css/app.css') }}"> Pay attention to the paths which file you copy. Works for me for Nova 3, in version 4 should be similar. |
Beta Was this translation helpful? Give feedback.
-
I think this is the best solution to apply custom styles to login page |
Beta Was this translation helpful? Give feedback.
-
It's: /vendor/laravel/nova/src/Nova.php #857
Not sure why they are making that stupid condition, it prohibit users from registering custom styles for the login as well, the availableStyles method is only called from within /vendor/laravel/nova/resources/views/layout.blade.php, probably removing this condition or at least filtering the styles to keep the user's predefined ones will be better. |
Beta Was this translation helpful? Give feedback.
-
Description:
Adding a custom css with
Nova::style('custom', public_path('nova.css'));
in NovaServiceProvider works well for all nova dashboard except login/auth routes. This file is not loaded there. I also tried adding this line in AppServiceProvider, didn't work.Detailed steps to reproduce the issue on a fresh Nova installation:
Nova::style('custom', public_path('nova.css'));
to NovaServiceProvider@boot<link rel="stylesheet" href="/nova-api/styles/custom-admin">
in the<head>
section. However, this line doesn't exist on Laravel Nova loginBeta Was this translation helpful? Give feedback.
All reactions