Log1x/filament-starter

Logo shared between frontend and filament - adapt tailwind config if use tailwind

Closed this issue ยท 4 comments

Hi, Thanks for this starter :) I'm discovering Laravel and Filament, and I think it's a great start ๐Ÿ‘

I wanted to change the logo on the filament side and discover that it was not picking up tailwind there and that's because the logo is in /resources/views/components/logo.blade.php which is not set in the "content" of tailwind.admin.js

You can fix the issue by just adding this line in the content of the tailwind.admin.js

 "./resources/**/*.blade.php"

but maybe it's worth to create a separate logo file in the filament view folder so we don't generate more class than needed for tailwind (eg the class use in the frontend but not in filament).

Hey, no problem!

Good catch. I hadn't ran into that since most of my logos end up being SVG with generic Tailwind classes that Filament conveniently already has compiled for me in most cases.

I'd say a standalone logo for Filament would be sane. I'm not entirely against having the Tailwind admin config pick up View Components (./resources/views/components/**/*.blade.php) but I do agree that in some cases it could be a little messy, especially if your frontend styling is extensive.

I'm open to opinions on what to do for filament-starter in particular out of the box. I'm somewhat leaning towards adding components to the admin Tailwind config to keep things simple and leaving further optimization up to the dev as they build out the project.

Mmm difficult to say what to do by default here :P

Many different solutions and all kind of easy to implement depending on the way you go.

Maybe just a comment / doc to say that the logo is shared between frontend / filament with the impact on tailwind and/or just add the full path to the logo component in tailwind.admin.js so we keep the "extra class" to a minimum.

I agree.

Let's just put the logo component under https://github.com/Log1x/filament-starter/blob/main/tailwind.admin.js#L10

Want to do a PR? If not, just let me know and I'll push something up.

You can do it :)